Skip to content

Commit

Permalink
fix deployment
Browse files Browse the repository at this point in the history
  • Loading branch information
anthony-nhs committed Sep 23, 2024
1 parent e6c82c9 commit 1bc15ac
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 3 deletions.
14 changes: 12 additions & 2 deletions .github/scripts/release_code.sh
Original file line number Diff line number Diff line change
Expand Up @@ -13,17 +13,24 @@ TRUSTSTORE_BUCKET_NAME=$(echo "${TRUSTSTORE_BUCKET_ARN}" | cut -d ":" -f 6)
LATEST_TRUSTSTORE_VERSION=$(aws s3api list-object-versions --bucket "${TRUSTSTORE_BUCKET_NAME}" --prefix "${TRUSTSTORE_FILE}" --query 'Versions[?IsLatest].[VersionId]' --output text)
export LATEST_TRUSTSTORE_VERSION

# get current deployed colour
a
#ws cloudformation describe-stacks --stack-name "${stack_name}"

# deploy blue stack
original_stack_name=${stack_name}
stack_name="${original_stack_name}-blue"
export stack_name
export deployment_colour="blue"
export RestApiGateway="n/a"
export RestApiGatewayStage="n/a"
cd ../../.aws-sam/build.main || exit
make sam-deploy-package

# get blue stack exports
RestApiGateway=$(aws cloudformation list-exports --output json | jq -r '.Exports[] | select(.Name == "${StackName}:RestApi:Gateway") | .Value' | grep -o '[^:]*$')
RestApiGateway=$(aws cloudformation list-exports --output json | jq -r '.Exports[] | select(.Name == "${stack_name}:RestApi:Gateway") | .Value' | grep -o '[^:]*$')
export RestApiGateway
RestApiGatewayStage=$(aws cloudformation list-exports --output json | jq -r '.Exports[] | select(.Name == "${StackName}:RestApi:Gateway:Stage") | .Value' | grep -o '[^:]*$')
RestApiGatewayStage=$(aws cloudformation list-exports --output json | jq -r '.Exports[] | select(.Name == "${stack_name}:RestApi:Gateway:Stage") | .Value' | grep -o '[^:]*$')
export RestApiGatewayStage

# deploy api-domain stack
Expand All @@ -35,5 +42,8 @@ make sam-deploy-package
# deploy green stack
stack_name="${original_stack_name}-green"
export stack_name
export deployment_colour="green"
export RestApiGateway="n/a"
export RestApiGatewayStage="n/a"
cd ../../.aws-sam/build.main || exit
make sam-deploy-package
3 changes: 2 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,8 @@ sam-deploy-package: guard-artifact_bucket guard-artifact_bucket_prefix guard-sta
--role-arn $$cloud_formation_execution_role \
--no-confirm-changeset \
--force-upload \
--tags "version=$$VERSION_NUMBER" \
--tags Key=version,Value=$$VERSION_NUMBER \
Key=deployment_colour,Value=$$deployment_colour \
--parameter-overrides \
TruststoreVersion=$$LATEST_TRUSTSTORE_VERSION \
EnableMutualTLS=$$enable_mutual_tls \
Expand Down

0 comments on commit 1bc15ac

Please sign in to comment.