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

[FEATURE] Add the ability to run against a stack by name or id #1353

Open
g13013 opened this issue Jan 10, 2024 · 3 comments
Open

[FEATURE] Add the ability to run against a stack by name or id #1353

g13013 opened this issue Jan 10, 2024 · 3 comments
Labels
enhancement New feature or request planned

Comments

@g13013
Copy link

g13013 commented Jan 10, 2024

Is your feature request related to a problem? Please describe.
Add the ability to run against a stack by name or id

Describe the solution you'd like
In a CI in our testing scenario, we are deploying the stable version first before deploying the new change, simulating an upgrade to the platform before production. the problem is, if the stack gets moved in the filesystem in the head version, even if terramate detects the changed stack in the new version, I could not know what is the corresponding location of the stack in the stable version, combined with #723 one could use the combination of terramate list --changed --json and terramate run -id stack_id to run the stacks in workflow matrix

  prepare_contaxt:
    name: Context
    runs-on: ubuntu-latest
    outputs:
      changed_stacks=${{steps.get_stacks.outputs.stacks}}
    steps:
      - id: get_stacks
        run: echo "stacks=$(terramate list --changed --json)" > $GITHUB_OUTPUT
  test_deploy:
    name: Deploy / Test
    runs-on: ubuntu-latest
    environment: Staging
    needs: prepare_context
    strategy:
      matrix:
        stack: ${{ fromJson(needs.prepare_context.outputs.changed_stacks) }}
   steps:
    # ...
    - name: deploy stable
      run: |
        terramate list --changed | grep ${{ stack.id }} && # run only if it exists in stable
        terramate run -id ${{ stack.id }} -- terraform apply

The case of terramate run --name is just a convenient way to run by stacks name rather than remembering tags. for now to run by name we had to duplicate the name in the tags !

Describe alternatives you've considered
Too long :)

@g13013 g13013 added the enhancement New feature or request label Jan 10, 2024
@g13013 g13013 changed the title [FEATURE] [FEATURE] Add the ability to run against a stack by name or id Jan 10, 2024
@mariux mariux unassigned i4ki and mariux Jan 25, 2024
@mariux
Copy link
Contributor

mariux commented Apr 17, 2024

Thanks for sharing this idea, we just have added the filter by ID to our priorities and it will be available soon in one of our next releases.

@mariux mariux added the planned label Apr 17, 2024
@g13013
Copy link
Author

g13013 commented May 15, 2024

@mariux could it be possible to add the filter by name as well ? as it will be more friendly to work with.

The only difference is that filtering by name could yield multiple results.

@g13013
Copy link
Author

g13013 commented May 15, 2024

Thank you also for the great work with Terramate, I love this tool!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request planned
Projects
None yet
Development

No branches or pull requests

3 participants