diff --git a/.github/scripts/release_code.sh b/.github/scripts/release_code.sh index 1e56b3999..024676406 100755 --- a/.github/scripts/release_code.sh +++ b/.github/scripts/release_code.sh @@ -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 @@ -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 diff --git a/Makefile b/Makefile index 546781bf6..b31d8fd97 100644 --- a/Makefile +++ b/Makefile @@ -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 \