Skip to content

Commit

Permalink
ci: display information about interface state
Browse files Browse the repository at this point in the history
  • Loading branch information
Integralist committed Sep 15, 2023
1 parent 5a29334 commit a720107
Showing 1 changed file with 15 additions and 13 deletions.
28 changes: 15 additions & 13 deletions tests/interface/script.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,17 @@

cd ./tests/interface/ || exit

echo DEPLOYING USING LATEST TERRAFORM VERSION
terraform init -upgrade
terraform apply -auto-approve

cleanup() {
# reset back to the installed provider so we can destroy the service
unset TF_CLI_CONFIG_FILE
terraform init
echo ""
echo "Running terraform destroy..."
terraform destroy -auto-approve
# reset back to the installed provider so we can destroy the service
unset TF_CLI_CONFIG_FILE
terraform init
echo ""
echo "Running terraform destroy..."
terraform destroy -auto-approve
}
trap cleanup EXIT

Expand All @@ -22,15 +23,16 @@ OVERRIDES_FILENAME=developer_overrides.tfrc
export TF_CLI_CONFIG_FILE="$BIN_DIR/$OVERRIDES_FILENAME"
cd - || exit

echo RUNNING PLAN USING TERRAFORM VERSION BUILT FROM THIS BRANCH
plan_output=$(terraform plan -no-color 2>&1)

if [[ "$plan_output" == *"No changes. Your infrastructure matches the configuration."* ]]; then
echo ""
echo "Terraform plan succeeded: No changes detected."
exit 0
echo ""
echo "Terraform plan succeeded: No changes detected."
exit 0
else
echo ""
echo "Terraform plan failed: Changes detected or unexpected output."
echo "$plan_output"
exit 1
echo ""
echo "Terraform plan failed: Changes detected or unexpected output."
echo "$plan_output"
exit 1
fi

0 comments on commit a720107

Please sign in to comment.