-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: stream terraform/helmfile output to stdout (#234)
- Loading branch information
Showing
7 changed files
with
35 additions
and
22 deletions.
There are no files selected for viewing
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,17 +1,20 @@ | ||
#!/bin/bash | ||
|
||
function helmfileApply { | ||
set -o pipefail | ||
tempfile=$(mktemp) | ||
# suppress secrets in workflows #incident-150567 | ||
output=$(helmfile --no-color apply --suppress-secrets ${*} 2>&1) | ||
helmfile --no-color apply --suppress-secrets ${*} 2>&1 | tee $tempfile | ||
exitCode=$? | ||
output=$(cat $tempfile) | ||
rm $tempfile | ||
|
||
if [ ${exitCode} -eq 0 ]; then | ||
echo "Successfully ran helmfile apply command." | ||
else | ||
echo "Error: Failed to run helmfile apply" | ||
fi | ||
|
||
echo "${output}" | ||
echo | ||
exit ${exitCode} | ||
} |
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,16 +1,18 @@ | ||
#!/bin/bash | ||
|
||
function terraformApply { | ||
output=$(terraform apply -no-color -auto-approve -input=false ${*} 2>&1) | ||
set -o pipefail | ||
tempfile=$(mktemp) | ||
terraform apply -no-color -auto-approve -input=false ${*} 2>&1 | tee $tempfile | ||
exitCode=$? | ||
output=$(cat $tempfile) | ||
rm $tempfile | ||
|
||
if [ ${exitCode} -eq 0 ]; then | ||
echo "Successfully ran terraform apply command." | ||
else | ||
echo "Error: Failed to run terraform apply" | ||
fi | ||
|
||
echo "${output}" | ||
echo | ||
exit ${exitCode} | ||
} |
This file contains 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
This file contains 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
This file contains 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
This file contains 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