File tree Expand file tree Collapse file tree 1 file changed +6
-8
lines changed
Expand file tree Collapse file tree 1 file changed +6
-8
lines changed Original file line number Diff line number Diff line change @@ -5,14 +5,12 @@ folders=$CHANGED_FOLDERS
55for f in ${folders// ,/ }
66do
77 f=$( echo $f | xargs echo -n)
8- (echo " ===> Terraform validating in" /src/$f && cd /src/$f && rm -f .terraform.lock.hcl && rm -rf .terraform && terraform init -upgrade && terraform validate -json | jq -e .valid) || error=true
9- if ${error} ; then
10- echo " ------------------------------------------------"
11- echo " "
12- echo " Some Terraform codes contain errors."
13- echo " $( cd /src/$f && terraform validate -json) "
14- echo " "
15- exit 1
8+ echo " ===> Terraform validating in" $f
9+ terraform -chdir=$f init -upgrade
10+ terraform -chdir=$f validate
11+ if [[ $? -ne 0 ]]; then
12+ echo -e " \033[1m[ERROR]\033[0m: Some quickstarts codes contain errors, and please running terraform validate command before pushing."
13+ exit 1
1614 fi
1715done
1816
You can’t perform that action at this time.
0 commit comments