|
1 |
| -#!/bin/bash -e |
| 1 | +#!/bin/bash |
2 | 2 |
|
3 | 3 | export CDK_PARAM_SYSTEM_ADMIN_EMAIL="$1"
|
4 | 4 |
|
@@ -72,25 +72,34 @@ export CDK_PARAM_TIER='basic'
|
72 | 72 | export CDK_PARAM_STAGE='prod'
|
73 | 73 |
|
74 | 74 | export CDK_BASIC_CLUSTER="$CDK_PARAM_STAGE-$CDK_PARAM_TIER"
|
75 |
| -SERVICES=$(aws ecs list-services --cluster $CDK_BASIC_CLUSTER --query 'serviceArns[*]' --output text) |
76 |
| -for SERVICE in $SERVICES; do |
77 |
| - SERVICE_NAME=$(echo $SERVICE | rev | cut -d '/' -f 1 | rev) |
78 |
| - |
79 |
| - echo -n "==== Service Connect Disable: " |
80 |
| - aws ecs update-service \ |
81 |
| - --cluster $CDK_BASIC_CLUSTER \ |
82 |
| - --service $SERVICE_NAME \ |
83 |
| - --service-connect-configuration 'enabled=false' \ |
84 |
| - --no-cli-pager --query 'service.serviceArn' --output text |
85 |
| - |
86 |
| -done |
87 | 75 |
|
88 | 76 | npm install
|
89 |
| - |
90 | 77 | npx cdk bootstrap
|
| 78 | + |
| 79 | +npx cdk diff tenant-template-stack-basic > ./diff_output.txt 2>&1 |
| 80 | +if grep -q "There were no differences" ./diff_output.txt; then |
| 81 | + echo "No changes detected in tenant-template-stack-basic." |
| 82 | +else |
| 83 | + echo "Changes detected in tenant-template-stack-basic." |
| 84 | + |
| 85 | + SERVICES=$(aws ecs list-services --cluster $CDK_BASIC_CLUSTER --query 'serviceArns[*]' --output text || true) |
| 86 | + for SERVICE in $SERVICES; do |
| 87 | + SERVICE_NAME=$(echo $SERVICE | rev | cut -d '/' -f 1 | rev) |
| 88 | + |
| 89 | + echo -n "==== Service Connect Disable: " |
| 90 | + aws ecs update-service \ |
| 91 | + --cluster $CDK_BASIC_CLUSTER \ |
| 92 | + --service $SERVICE_NAME \ |
| 93 | + --service-connect-configuration 'enabled=false' \ |
| 94 | + --no-cli-pager --query 'service.serviceArn' --output text |
| 95 | + done |
| 96 | +fi |
| 97 | +rm diff_output.txt |
| 98 | + |
91 | 99 | npx cdk deploy --all --require-approval=never
|
92 | 100 |
|
93 |
| -# Get SaaS application url |
| 101 | + |
| 102 | +## Get SaaS application url |
94 | 103 | ADMIN_SITE_URL=$(aws cloudformation describe-stacks --stack-name controlplane-stack --query "Stacks[0].Outputs[?OutputKey=='adminSiteUrl'].OutputValue" --output text)
|
95 | 104 | APP_SITE_URL=$(aws cloudformation describe-stacks --stack-name core-appplane-stack --query "Stacks[0].Outputs[?OutputKey=='appSiteUrl'].OutputValue" --output text)
|
96 | 105 | echo "Admin site url: $ADMIN_SITE_URL"
|
|
0 commit comments