File tree Expand file tree Collapse file tree 3 files changed +8
-10
lines changed Expand file tree Collapse file tree 3 files changed +8
-10
lines changed Original file line number Diff line number Diff line change 68
68
working-directory : ${{ env.terraform-working-directory }}
69
69
run : |
70
70
terraform init -backend-config="env/${{ inputs.environment }}-backend.hcl" -upgrade
71
- terraform plan -var="image_digest=$DIGEST" - target=aws_ecs_task_definition.task_definition \
71
+ terraform plan -target=aws_ecs_task_definition.task_definition \
72
72
-target=aws_s3_object.appspec_object -var-file="env/${{ inputs.environment }}.tfvars" \
73
- -out=${{ runner.temp }}/tfplan | tee ${{ runner.temp }}/tf_stdout
73
+ -var="image_digest=$DIGEST" - out=${{ runner.temp }}/tfplan | tee ${{ runner.temp }}/tf_stdout
74
74
- name : Validate the changes
75
75
run : |
76
76
./terraform/scripts/check_task_definition.sh ${{ runner.temp }}/tf_stdout
@@ -143,9 +143,8 @@ jobs:
143
143
run : |
144
144
source ${{ runner.temp }}/artifact/CODEDEPLOY_ENV
145
145
deployment_id=$(aws deploy create-deployment \
146
- --application-name $application --deployment-group-name $application_group \
147
- --s3-location bucket=appspec-bucket-${{ inputs.environment }},key=appspec.yaml,bundleType=yaml \
148
- | jq -r .deploymentId)
146
+ --application-name "$application" --deployment-group-name "$application_group" \
147
+ --s3-location bucket="$s3_bucket",key="$s3_key",bundleType=yaml | jq -r .deploymentId)
149
148
echo "Deployment started: $deployment_id"
150
149
echo "deployment_id=$deployment_id" >> $GITHUB_ENV
151
150
- name : Wait up to 30 minutes for deployment to complete
Original file line number Diff line number Diff line change @@ -23,4 +23,3 @@ http_hosts = {
23
23
}
24
24
minimum_replicas = 3
25
25
appspec_bucket = " nhse-mavis-appspec-bucket-qa"
26
- image_digest = " sha256:b35aa00cd4e61cc796f9c852291fb5ea188e33a08ce84a9ca1519b57c77d9a31"
Original file line number Diff line number Diff line change 23
23
echo " S3 bucket object is not being replaced, aborting."
24
24
exit 1
25
25
fi
26
- MODIFICATIONS=$( grep -E " [0-9]+ to add, [0-9]+ to change, [0-9]+ to destroy." test_less )
27
- ADDITIONS=$( echo " $MODIFICATIONS " | sed -E ' s/.*([0-9]+) to add.*/\1/' )
28
- CHANGES=$( echo " $MODIFICATIONS " | sed -E ' s/.*([0-9]+) to change.*/\1/' )
29
- DELETIONS=$( echo " $MODIFICATIONS " | sed -E ' s/.*([0-9]+) to destroy.*/\1/' )
26
+ MODIFICATIONS=$( grep -E " [0-9]+ to add, [0-9]+ to change, [0-9]+ to destroy." " $tf_stdout " ) || exit 1
27
+ ADDITIONS=$( echo " $MODIFICATIONS " | sed -E ' s/.*([0-9]+) to add.*/\1/' ) || exit 1
28
+ CHANGES=$( echo " $MODIFICATIONS " | sed -E ' s/.*([0-9]+) to change.*/\1/' ) || exit 1
29
+ DELETIONS=$( echo " $MODIFICATIONS " | sed -E ' s/.*([0-9]+) to destroy.*/\1/' ) || exit 1
30
30
if [[ $DELETIONS -gt $ADDITIONS ]]; then
31
31
echo " More resources are being destroyed than created."
32
32
echo " Other resources than task definition and s3 bucket object are being deleted, aborting."
You can’t perform that action at this time.
0 commit comments