Skip to content

Commit

Permalink
fix no tf lockfiles for excludedLockDirs
Browse files Browse the repository at this point in the history
  • Loading branch information
elchead committed Nov 28, 2023
1 parent 3c79f54 commit 83cbe5a
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion bazel/ci/terraform.sh.in
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ check() {
for exclude in "${excludeLockDirs[@]}"; do
for i in "${!terraformLockModules[@]}"; do
if [[ ${terraformLockModules[i]} == "${BUILD_WORKSPACE_DIRECTORY}/${exclude}"* ]]; then
echo " ${terraformLockModules[i]}"
echo "${terraformLockModules[i]}"
unset 'terraformLockModules[i]'
fi
done
Expand Down Expand Up @@ -119,6 +119,14 @@ check() {
${terraform} -chdir="${module}" fmt -recursive > /dev/null
${terraform} -chdir="${module}" validate > /dev/null
rm -rf "${module}/.terraform"
echo "Deleting lock files in the following directories:" # init generates lockfiles which should only be generated in the generate mode.
for dir in "${excludeLockDirs[@]}"; do
if [[ -d ${dir} ]]; then
find "${dir}" -name '*.lock.hcl' -type f -delete
else
echo " Directory ${dir} does not exist, skipping"
fi
done
done
;;

Expand Down

0 comments on commit 83cbe5a

Please sign in to comment.