Skip to content

Commit be0caa1

Browse files
committed
Fix bugs introduced by linting changes.
1 parent e3b1785 commit be0caa1

2 files changed

Lines changed: 23 additions & 8 deletions

File tree

deploy.sh

Lines changed: 16 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -400,6 +400,10 @@ if [ $stack_status -eq 2 ]; then
400400
fi
401401
if [ $stack_status -eq 0 ]; then
402402
create_cognito_pool "$userpoolstackname"
403+
if ! create_cognito_pool "$userpoolstackname"; then
404+
aws cloudformation describe-stack-events --stack-name "$userpoolstackname"
405+
exit 1
406+
fi
403407
fi
404408

405409
#Capture User Pool Client ID
@@ -434,7 +438,10 @@ if [ $stack_status -eq 2 ]; then
434438
stack_status=0
435439
fi
436440
if [ $stack_status -eq 0 ]; then
437-
create_doc_db "$docdbstackname"
441+
if ! create_doc_db "$docdbstackname"; then
442+
aws cloudformation describe-stack-events --stack-name "$docdbstackname"
443+
exit 1
444+
fi
438445
fi
439446
calculate_duration "DocumentDB Instance Creation" "$docdb_start_time"
440447

@@ -467,7 +474,10 @@ if [ $stack_status -eq 2 ]; then
467474
stack_status=0
468475
fi
469476
if [ $stack_status -eq 0 ]; then
470-
create_image_builder "$imgbldrstackname"
477+
if ! create_image_builder "$imgbldrstackname"; then
478+
aws cloudformation describe-stack-events --stack-name "$imgbldrstackname"
479+
exit 1
480+
fi
471481
fi
472482
calculate_duration "Image Builder Stack Creation" "$imgbldr_start_time"
473483

@@ -496,7 +506,10 @@ if [ $stack_status -eq 2 ]; then
496506
stack_status=0
497507
fi
498508
if [ $stack_status -eq 0 ]; then
499-
create_main_stack "$mainstackname"
509+
if ! create_main_stack "$mainstackname"; then
510+
aws cloudformation describe-stack-events --stack-name "$mainstackname"
511+
exit 1
512+
fi
500513
fi
501514
echo "Obtaining MainStack outputs"
502515
portalinstance_id=$(aws cloudformation describe-stack-resources --stack-name "$mainstackname" --logical-resource-id "RGEC2Instance" | jq -r '.StackResources[] | .PhysicalResourceId')

scripts/fixsecrets.sh

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,17 @@
11
#!/bin/bash
2-
version="0.1.3"
2+
version="0.1.4"
33
echo "Fixing secrets...(fixsecrets.sh v$version)"
44

55
[ -z "$RG_HOME" ] && RG_HOME='/opt/deploy/sp2'
66
echo "RG_HOME=$RG_HOME"
77

8-
cd "$RG_HOME" || echo "Could not cd to $RG_HOME" && exit 1
98
old_secrets=$(docker secret ls | grep -i sp2prod | awk '{print $1}')
109
if [ ! -z "$old_secrets" ]; then
1110
echo "Found old secrets. Removing..."
12-
docker secret rm "$old_secrets"
11+
echo "$old_secrets" |
12+
while IFS=$'\n' read -r mysecret; do
13+
docker secret rm "$mysecret"
14+
done
1315
fi
14-
docker secret create sp2prod-config.json ./config/config.json
15-
docker secret create sp2prod-alert-config.json ./config/alert-config.json
16+
docker secret create sp2prod-config.json "${RG_HOME}/config/config.json"
17+
docker secret create sp2prod-alert-config.json "${RG_HOME}/config/alert-config.json"

0 commit comments

Comments
 (0)