Created
February 7, 2023 15:35
-
-
Save artem-hatchenko/87686f44ec4ef480f5c81566fe7eda3c to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Block for the modules | |
check_modules() { | |
# Run the "tflint" command and write the result to the $MODULES_OUTPUT file | |
cd $TF_DIR/$MODULE_DIR/$1 | |
echo -e "\nMODULE: $1" | tee -a $MODULES_OUTPUT | |
if grep -qP '^module' *.tf | |
then echo "Found module call. Running terraform init..." | |
terraform init &>/dev/null | |
$TFLIT --config $MODULES_CONF_FILE | tee -a $MODULES_OUTPUT | |
rm -rf .terraform* | |
else | |
$TFLIT --config $MODULES_CONF_FILE | tee -a $MODULES_OUTPUT | |
fi | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment