diff --git a/fast/stages-multitenant/0-bootstrap-tenant/templates/workflow-github.yaml b/fast/stages-multitenant/0-bootstrap-tenant/templates/workflow-github.yaml index 523258680..364ee8f46 100644 --- a/fast/stages-multitenant/0-bootstrap-tenant/templates/workflow-github.yaml +++ b/fast/stages-multitenant/0-bootstrap-tenant/templates/workflow-github.yaml @@ -92,11 +92,13 @@ jobs: # run Terraform init/validate/plan - id: tf-init name: Terraform init + continue-on-error: true run: | terraform init -no-color - id: tf-validate name: Terraform validate + continue-on-error: true run: terraform validate -no-color - id: tf-plan @@ -179,6 +181,16 @@ jobs: body: output }) + - id: check-init + name: Check init failure + if: steps.tf-init.outcome != 'success' + run: exit 1 + + - id: check-validate + name: Check validate failure + if: steps.tf-validate.outcome != 'success' + run: exit 1 + - id: check-plan name: Check plan failure if: steps.tf-plan.outcome != 'success' diff --git a/fast/stages-multitenant/1-resman-tenant/templates/workflow-github.yaml b/fast/stages-multitenant/1-resman-tenant/templates/workflow-github.yaml index 8a946d84c..e96699092 100644 --- a/fast/stages-multitenant/1-resman-tenant/templates/workflow-github.yaml +++ b/fast/stages-multitenant/1-resman-tenant/templates/workflow-github.yaml @@ -88,11 +88,13 @@ jobs: # run Terraform init/validate/plan - id: tf-init name: Terraform init + continue-on-error: true run: | terraform init -no-color - id: tf-validate name: Terraform validate + continue-on-error: true run: terraform validate -no-color - id: tf-plan @@ -175,6 +177,16 @@ jobs: body: output }) + - id: check-init + name: Check init failure + if: steps.tf-init.outcome != 'success' + run: exit 1 + + - id: check-validate + name: Check validate failure + if: steps.tf-validate.outcome != 'success' + run: exit 1 + - id: check-plan name: Check plan failure if: steps.tf-plan.outcome != 'success' diff --git a/fast/stages/0-bootstrap/templates/workflow-github.yaml b/fast/stages/0-bootstrap/templates/workflow-github.yaml index 8a946d84c..87b5ae1a0 100644 --- a/fast/stages/0-bootstrap/templates/workflow-github.yaml +++ b/fast/stages/0-bootstrap/templates/workflow-github.yaml @@ -29,7 +29,9 @@ env: FAST_WIF_PROVIDER: ${identity_provider} SSH_AUTH_SOCK: /tmp/ssh_agent.sock TF_PROVIDERS_FILE: ${tf_providers_file} - TF_VAR_FILES: ${tf_var_files == [] ? "''" : join("\n ", tf_var_files)} + %{~ if tf_var_files != [] ~} + TF_VAR_FILES: ${join("\n ", tf_var_files)} + %{~ endif ~} TF_VERSION: 1.3.2 jobs: @@ -73,11 +75,13 @@ jobs: run: | gcloud alpha storage cp -r \ "gs://$${{env.FAST_OUTPUTS_BUCKET}}/providers/$${{env.TF_PROVIDERS_FILE}}" ./ + %{~ if tf_var_files != [] ~} gcloud alpha storage cp -r \ "gs://$${{env.FAST_OUTPUTS_BUCKET}}/tfvars" ./ for f in $${{env.TF_VAR_FILES}}; do ln -s "tfvars/$f" ./ done + %{~ endif ~} - id: tf-setup name: Set up Terraform @@ -88,10 +92,12 @@ jobs: # run Terraform init/validate/plan - id: tf-init name: Terraform init + continue-on-error: true run: | terraform init -no-color - id: tf-validate + continue-on-error: true name: Terraform validate run: terraform validate -no-color @@ -175,6 +181,16 @@ jobs: body: output }) + - id: check-init + name: Check init failure + if: steps.tf-init.outcome != 'success' + run: exit 1 + + - id: check-validate + name: Check validate failure + if: steps.tf-validate.outcome != 'success' + run: exit 1 + - id: check-plan name: Check plan failure if: steps.tf-plan.outcome != 'success' diff --git a/fast/stages/1-resman/templates/workflow-github.yaml b/fast/stages/1-resman/templates/workflow-github.yaml index 8a946d84c..41c51411d 100644 --- a/fast/stages/1-resman/templates/workflow-github.yaml +++ b/fast/stages/1-resman/templates/workflow-github.yaml @@ -88,10 +88,12 @@ jobs: # run Terraform init/validate/plan - id: tf-init name: Terraform init + continue-on-error: true run: | terraform init -no-color - id: tf-validate + continue-on-error: true name: Terraform validate run: terraform validate -no-color @@ -175,6 +177,16 @@ jobs: body: output }) + - id: check-init + name: Check init failure + if: steps.tf-init.outcome != 'success' + run: exit 1 + + - id: check-validate + name: Check validate failure + if: steps.tf-validate.outcome != 'success' + run: exit 1 + - id: check-plan name: Check plan failure if: steps.tf-plan.outcome != 'success'