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
Given this example (below), I find myself having to set
shell
over and over for eachcmd
. In my current project I have this for eachcmd
which is 15 times (and growing). It would be a nice QoL to be able to set some kind of top leveldefault
configuration to keep my task actions a lil drier. Maybe this could apply to other features likemaxRetries, maxTotalSeconds, mute
. Additionally the defaults need to be overridable at each individual action.thx