mirror of
https://github.com/edgelesssys/constellation.git
synced 2025-03-28 01:28:26 -04:00
bazel: add terraform fmt to //:tidy target (#1501)
Signed-off-by: Paul Meyer <49727155+katexochen@users.noreply.github.com>
This commit is contained in:
parent
7d899d7aa5
commit
b65b09fd9f
@ -195,6 +195,18 @@ sh_template(
|
||||
template = "tf.sh.in",
|
||||
)
|
||||
|
||||
sh_template(
|
||||
name = "terraform_fmt",
|
||||
data = [
|
||||
":com_github_hashicorp_terraform",
|
||||
],
|
||||
substitutions = {
|
||||
"@@MODE@@": "format",
|
||||
"@@TERRAFORM@@": "$(rootpath :com_github_hashicorp_terraform)",
|
||||
},
|
||||
template = "tf.sh.in",
|
||||
)
|
||||
|
||||
multirun(
|
||||
name = "tidy",
|
||||
commands = [
|
||||
@ -204,6 +216,7 @@ multirun(
|
||||
":gazelle_update_repos",
|
||||
":gazelle_generate",
|
||||
":buildifier_fix",
|
||||
":terraform_fmt",
|
||||
],
|
||||
jobs = 1, # execute sequentially
|
||||
visibility = ["//visibility:public"],
|
||||
|
@ -57,6 +57,14 @@ case ${mode} in
|
||||
done
|
||||
;;
|
||||
|
||||
"format")
|
||||
echo "Formatting the following Terraform modules:"
|
||||
for module in "${terraformModules[@]}"; do
|
||||
echo " ${module}"
|
||||
${terraform} -chdir="${module}" fmt -recursive > /dev/null
|
||||
done
|
||||
;;
|
||||
|
||||
"generate")
|
||||
echo "Formatting and generating lock files for the following Terraform modules:"
|
||||
for script in "${terraformModules[@]}"; do
|
||||
@ -70,7 +78,6 @@ case ${mode} in
|
||||
${terraform} -chdir="${module}" providers lock -platform=darwin_arm64 > /dev/null
|
||||
${terraform} -chdir="${module}" providers lock -platform=darwin_amd64 > /dev/null
|
||||
${terraform} -chdir="${module}" providers lock -platform=windows_amd64 > /dev/null
|
||||
${terraform} -chdir="${module}" fmt -recursive > /dev/null
|
||||
rm -rf "${module}/.terraform"
|
||||
done
|
||||
;;
|
||||
|
Loading…
x
Reference in New Issue
Block a user