ci: added ci pipelines
Some checks reported errors
continuous-integration/drone/push Build encountered an error

This commit is contained in:
2022-05-26 23:17:00 +02:00
parent d5e9fe017f
commit 5cf2f5d7a5
5 changed files with 141 additions and 1 deletions

21
scripts/format.sh Normal file
View File

@@ -0,0 +1,21 @@
#!/bin/bash
set -euo pipefail
for DIR in $(find . -type d); do
if [[ "${DIR}" = "." ]] || [[ $(echo ${DIR} | cut -c1-5) = ".git/" ]]; then
continue;
fi
pushd $DIR
terraform_files=$(find . -maxdepth 1 -type f -iname '*.tf')
if [[ ${#terraform_files} -eq 0 ]]; then
popd
continue
fi
terraform fmt
popd
done

View File

@@ -15,4 +15,4 @@ for DIR in $(find . -type d); do
terraform-docs markdown document . > README.md
popd
done
done

22
scripts/validate.sh Normal file
View File

@@ -0,0 +1,22 @@
#!/bin/bash
set -euo pipefail
for DIR in $(find . -type d); do
if [[ "${DIR}" = "." ]] || [[ $(echo ${DIR} | cut -c1-5) = ".git/" ]]; then
continue;
fi
pushd $DIR
terraform_files=$(find . -maxdepth 1 -type f -iname '*.tf')
if [[ ${#terraform_files} -eq 0 ]]; then
popd
continue
fi
terraform init
terraform validate
popd
done