From 2f56a0c79093edbfa099b77e5e5c008fcff3c22c Mon Sep 17 00:00:00 2001 From: DeveloperDurp Date: Fri, 4 Nov 2022 21:22:37 +0000 Subject: [PATCH] Update .gitlab-ci.yml --- .gitlab-ci.yml | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 7aba925..dda209b 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -30,7 +30,11 @@ plan: - alias convert_report="jq -r '([.resource_changes[].change.actions?]|flatten)|{\"create\":(map(select(.==\"create\"))|length),\"update\":(map(select(.==\"update\"))|length),\"delete\":(map(select(.==\"delete\"))|length)}'" - terraform --version - terraform init -reconfigure -backend-config="address=${GITLAB_TF_ADDRESS}" -backend-config="lock_address=${GITLAB_TF_ADDRESS}/lock" -backend-config="unlock_address=${GITLAB_TF_ADDRESS}/lock" -backend-config="username=gitlab-ci-token" -backend-config="password=${CI_JOB_TOKEN}" -backend-config="lock_method=POST" -backend-config="unlock_method=DELETE" -backend-config="retry_wait_min=5" - - terraform plan -var-file=terraform.tfvars + - terraform plan -var-file=terraform.tfvars -out=$PLAN + - terraform show --json $PLAN | convert_report > $PLAN_JSON + artifacts: + reports: + terraform: $PLAN_JSON only: changes: - terraform.tf @@ -140,4 +144,4 @@ ansible-update-dns: - ansible-playbook $CI_PROJECT_DIR/jobs/dns.yml only: changes: - - jobs/dns.yml \ No newline at end of file + - jobs/dns.yml