MON-486 remove workaround for here doc bug with fmt

This commit is contained in:
Quentin Manfroi 2019-08-01 13:20:30 +02:00
parent 85854e5baf
commit c16e807c1a

View File

@ -4,7 +4,7 @@ set -xueo pipefail
source "$(dirname $0)/utils.sh" source "$(dirname $0)/utils.sh"
goto_root goto_root
for path in $(find "$(get_scope $1)" -name 'inputs.tf' -print); do for path in $(find "$(get_scope $1)" -name 'inputs.tf' -print); do
dir=$(dirname ${path}) dir=$(dirname ${path})
cat <<EOF > ${dir}/tmp.tf cat <<EOF > ${dir}/tmp.tf
provider "datadog" { provider "datadog" {
@ -31,11 +31,7 @@ EOF
terraform init ${dir} terraform init ${dir}
terraform validate ${dir} terraform validate ${dir}
rm -f ${dir}/tmp.tf rm -f ${dir}/tmp.tf
# hack to work around bug https://github.com/hashicorp/terraform/issues/21434
# TODO when fixed, remove this bloc and add "terraform fmt -recursive" to the end of this file
for file in $(grep ' = <<E' ${dir}/* | cut -d':' -f1 | sort | uniq); do
sed -Ei '/<<EO(Q|F)/,/EO(Q|F)/ s/^#*/#/' ${file}
terraform fmt ${dir}
sed -Ei '/<<EO(Q|F)/,/EO(Q|F)/ s/^[[:space:]]*#//' ${file}
done
done done
terraform fmt -recursive