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 ability to set top-level defaults for actions #36

Open
zack-is-cool opened this issue Mar 20, 2024 · 1 comment
Open

Add ability to set top-level defaults for actions #36

zack-is-cool opened this issue Mar 20, 2024 · 1 comment
Labels
enhancement ✨ New feature or request

Comments

@zack-is-cool
Copy link
Member

Given this example (below), I find myself having to set shell over and over for each cmd. In my current project I have this for each cmd which is 15 times (and growing). It would be a nice QoL to be able to set some kind of top level default configuration to keep my task actions a lil drier. Maybe this could apply to other features like maxRetries, maxTotalSeconds, mute. Additionally the defaults need to be overridable at each individual action.

    actions:
      - task: check-env
        with:
          env: ${ENV}
      - description: "Check if bootstrap for '$env' is clean"
        cmd: |
          set -exo pipefail
          # check if ./iac/env/${INPUT_ENV}/backends/bootstrap-backend.tfconfig exists
          if [ -f ./iac/env/${INPUT_ENV}/backends/bootstrap-backend.tfconfig ]; then
            echo "terraform s3 backend environment files for ${INPUT_ENV} already exists"
            exit 1
          fi
        shell:
          linux: bash
          darwin: bash
      - description: "Init the bootstrap module"
        task: terraform-init
        with:
          root_module: bootstrap
      - description: "Apply the bootstrap module in the specified environment"
        task: terraform-apply
        with:
          env: ${ENV}
          root_module: bootstrap
          var_files: '["common.terraform.tfvars", "bootstrap.terraform.tfvars"]'
      - description: "Migrate local backend to s3"
        cmd: |
          set -exo pipefail
          cd ./iac/bootstrap
          terraform init --reconfigure --force-copy --backend-config=../env/${INPUT_ENV}/backends/bootstrap-backend.tfconfig && \
            mv terraform.tfstate "terraform-tfstate.${INPUT_ENV}-local-backend-backup"
        shell:
          linux: bash
          darwin: bash

thx

@zack-is-cool zack-is-cool added the enhancement ✨ New feature or request label Mar 20, 2024
@UncleGedd
Copy link
Collaborator

Thanks @zack-is-cool we will prioritize and implement

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

No branches or pull requests

2 participants