Skip to content

Commit

Permalink
chore(integ): improve logging when refreshing credentials (#504)
Browse files Browse the repository at this point in the history
  • Loading branch information
jericht authored Jul 9, 2021
1 parent ce55fcc commit 21a8080
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 8 deletions.
10 changes: 5 additions & 5 deletions integ/components/deadline/common/scripts/bash/deploy-utils.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ function run_aws_interaction_hook() {
# Invoke hook function if it is exported and name is defined in PRE_AWS_INTERACTION_HOOK variable
if [ ! -z "${PRE_AWS_INTERACTION_HOOK+x}" ] && [ "$(type -t $PRE_AWS_INTERACTION_HOOK)" == "function" ]
then
$PRE_AWS_INTERACTION_HOOK
$PRE_AWS_INTERACTION_HOOK "${1:-}"
fi
}

Expand All @@ -31,7 +31,7 @@ function deploy_component_stacks () {
# Synthesis requires AWS API calls for the context methods
# (https://docs.aws.amazon.com/cdk/latest/guide/context.html#context_methods)
# in our case this is for stack.availabilityZones
run_aws_interaction_hook
run_aws_interaction_hook "$(timestamp) [${COMPONENT_NAME}]"

npx cdk synth &> "${INTEG_TEMP_DIR}/${COMPONENT_NAME}/synth.log"
SYNTH_EXIT_CODE=$?
Expand All @@ -51,7 +51,7 @@ function deploy_component_stacks () {
cp /dev/null "${deploy_log_path}"

for stack in $(cdk_stack_deploy_order); do
run_aws_interaction_hook
run_aws_interaction_hook "$(timestamp) [${COMPONENT_NAME}]"

echo "$(timestamp) [${COMPONENT_NAME}] -> [${stack}] stack deployment started"
npx cdk deploy --app cdk.out --require-approval=never -e "${stack}" &>> "${deploy_log_path}"
Expand Down Expand Up @@ -86,7 +86,7 @@ function cdk_stack_destroy_order () {
function execute_component_test () {
COMPONENT_NAME=$1

run_aws_interaction_hook
run_aws_interaction_hook "$(timestamp) [${COMPONENT_NAME}]"

test_report_path="${INTEG_TEMP_DIR}/${COMPONENT_NAME}/test-report.json"
test_output_path="${INTEG_TEMP_DIR}/${COMPONENT_NAME}/test-output.txt"
Expand All @@ -106,7 +106,7 @@ function destroy_component_stacks () {
# Empty the destroy log file in case it was non-empty
cp /dev/null "${destroy_log_path}"
for stack in $(cdk_stack_destroy_order); do
run_aws_interaction_hook
run_aws_interaction_hook "$(timestamp) [${COMPONENT_NAME}]"

echo "$(timestamp) [${COMPONENT_NAME}] -> [${stack}] stack destroy started"
npx cdk destroy --app cdk.out -e -f "${stack}" &>> "${destroy_log_path}"
Expand Down
2 changes: 1 addition & 1 deletion integ/scripts/bash/run-e2e-automated.sh
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
set -euo pipefail

refreshcreds() {
echo "Refreshing credentials"
echo "${1:-} Refreshing credentials"
unset AWS_ACCESS_KEY_ID
unset AWS_SECRET_ACCESS_KEY
unset AWS_SESSION_TOKEN
Expand Down
2 changes: 1 addition & 1 deletion integ/scripts/bash/tear-down.sh
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ for COMPONENT in **/cdk.json; do
fi
done

run_aws_interaction_hook
run_aws_interaction_hook "$(timestamp) [infrastructure]"

cd "$INFRASTRUCTURE_APP" && npx cdk destroy "*" -f

Expand Down
2 changes: 1 addition & 1 deletion integ/scripts/bash/teardown-infrastructure.sh
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ echo "$(timestamp) [infrastructure] destroy started"
INFRASTRUCTURE_APP="$INTEG_ROOT/components/_infrastructure"
cd "$INFRASTRUCTURE_APP"

run_aws_interaction_hook
run_aws_interaction_hook "$(timestamp) [infrastructure]"

mkdir -p "${INTEG_TEMP_DIR}/infrastructure"

Expand Down

0 comments on commit 21a8080

Please sign in to comment.