mirror of
https://github.com/edgelesssys/constellation.git
synced 2025-07-21 06:21:43 -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
2 changed files with 21 additions and 1 deletions
|
@ -195,6 +195,18 @@ sh_template(
|
||||||
template = "tf.sh.in",
|
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(
|
multirun(
|
||||||
name = "tidy",
|
name = "tidy",
|
||||||
commands = [
|
commands = [
|
||||||
|
@ -204,6 +216,7 @@ multirun(
|
||||||
":gazelle_update_repos",
|
":gazelle_update_repos",
|
||||||
":gazelle_generate",
|
":gazelle_generate",
|
||||||
":buildifier_fix",
|
":buildifier_fix",
|
||||||
|
":terraform_fmt",
|
||||||
],
|
],
|
||||||
jobs = 1, # execute sequentially
|
jobs = 1, # execute sequentially
|
||||||
visibility = ["//visibility:public"],
|
visibility = ["//visibility:public"],
|
||||||
|
|
|
@ -57,6 +57,14 @@ case ${mode} in
|
||||||
done
|
done
|
||||||
;;
|
;;
|
||||||
|
|
||||||
|
"format")
|
||||||
|
echo "Formatting the following Terraform modules:"
|
||||||
|
for module in "${terraformModules[@]}"; do
|
||||||
|
echo " ${module}"
|
||||||
|
${terraform} -chdir="${module}" fmt -recursive > /dev/null
|
||||||
|
done
|
||||||
|
;;
|
||||||
|
|
||||||
"generate")
|
"generate")
|
||||||
echo "Formatting and generating lock files for the following Terraform modules:"
|
echo "Formatting and generating lock files for the following Terraform modules:"
|
||||||
for script in "${terraformModules[@]}"; do
|
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_arm64 > /dev/null
|
||||||
${terraform} -chdir="${module}" providers lock -platform=darwin_amd64 > /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}" providers lock -platform=windows_amd64 > /dev/null
|
||||||
${terraform} -chdir="${module}" fmt -recursive > /dev/null
|
|
||||||
rm -rf "${module}/.terraform"
|
rm -rf "${module}/.terraform"
|
||||||
done
|
done
|
||||||
;;
|
;;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue