Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add oblt-cli/flags action #27

Draft
wants to merge 9 commits into
base: main
Choose a base branch
from
Draft

Conversation

reakaleek
Copy link
Member

No description provided.

@reakaleek reakaleek marked this pull request as draft June 4, 2024 11:50
@reakaleek reakaleek added the changelog:feature When you add a new feature label Jun 4, 2024
@reakaleek
Copy link
Member Author

@v1v I was playing around with this a bit.

But this is the only common I could find across the commands.

Adding all the cases would make this unnecessarily complex.

Should we still use this for the common flags?

@reakaleek reakaleek requested a review from v1v June 5, 2024 12:27
@v1v
Copy link
Member

v1v commented Jun 5, 2024

Should we still use this for the common flags?

Maybe we need one per cli flag?

  • oblt-cli/flag-prefix
  • oblt-cli/flag-suffix
  • oblt-cli/flag-gitops

Then consumers can choose the ones they need , for instance , oblt-cli/cluster-create-serverless/action.yml could be changed to something like:

name: 'oblt-cli/cluster-create-serverless'
description: 'Run the oblt-cli wrapper to create a serverless cluster.'
inputs:
...
runs:
  using: "composite"
  steps:
   - uses: elastic/oblt-actions/oblt-cli/flags-prefix@v1
      id: prefix
      with:
        cluster-name-prefix: 'prefix'

    - uses: elastic/oblt-actions/oblt-cli/flags-suffix@v1
      id: suffix
      with:
        cluster-name-suffix: 'suffix'

    - uses: elastic/oblt-actions/oblt-cli/flags-gitops@v1
      id: gitops
      with:
        gitops: true

    - uses: elastic/oblt-actions/oblt-cli/flags-dry-run@v1
      id: dry-run
      with:
        dry-run: true

    - uses: elastic/oblt-actions/oblt-cli/setup@v1.2.0
      with:
        github-token: ${{ inputs.github-token }}
        slack-channel: ${{ inputs.slack-channel }}
        username: ${{ inputs.username }}

    - run: |
        oblt-cli cluster create custom \
          --template serverless \
          ${{ steps.dry-run.outputs.params }} \
          ${{ steps.gitops.outputs.params }} \
          ${{ steps.suffix.outputs.params }} \
          ${{ steps.prefix.outputs.params }}
      shell: bash
      env:
        GITHUB_TOKEN: ${{ inputs.github-token }}

What do you think?

@reakaleek
Copy link
Member Author

Maybe we need one per cli flag?

IMO, all those params can be put into a single action.
The complexity lies in the logic when gitops: true is enabled.
which is totally different for cluster-create-ccs.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
changelog:feature When you add a new feature
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants