From 01e4ae40700a3f583c41e7d3d8f422b6aa033b0f Mon Sep 17 00:00:00 2001 From: Souhaila Noor Date: Tue, 2 Nov 2021 14:13:53 -0500 Subject: [PATCH] fix missing plan file for terraform apply --- .gitlab/.gitlab-ci.yml | 22 ++++++++++++++++++---- 1 file changed, 18 insertions(+), 4 deletions(-) diff --git a/.gitlab/.gitlab-ci.yml b/.gitlab/.gitlab-ci.yml index 67f2250a8..fc415a28b 100644 --- a/.gitlab/.gitlab-ci.yml +++ b/.gitlab/.gitlab-ci.yml @@ -3,7 +3,6 @@ include: - template: Security/License-Scanning.gitlab-ci.yml - template: Security/Dependency-Scanning.gitlab-ci.yml - stages: - test - build @@ -147,6 +146,9 @@ init terraform: - cd .terraform script: - gitlab-terraform init + cache: + paths: + - .terraform validate terraform: stage: deploy @@ -157,6 +159,9 @@ validate terraform: - gitlab-terraform validate needs: - job: init terraform + cache: + paths: + - .terraform plan terraform: stage: deploy @@ -164,9 +169,15 @@ plan terraform: before_script: - cd .terraform script: - - gitlab-terraform plan + - gitlab-terraform plan -out=plan.tfplan needs: - job: validate terraform + cache: + paths: + - .terraform + artifacts: + paths: + - plan.tfplan apply terraform: stage: deploy @@ -174,6 +185,9 @@ apply terraform: before_script: - cd .terraform script: - - gitlab-terraform apply + - gitlab-terraform apply -input=false plan.tfplan needs: - - job: plan terraform \ No newline at end of file + - job: plan terraform + cache: + paths: + - .terraform \ No newline at end of file