-
Notifications
You must be signed in to change notification settings - Fork 3
/
deploy_resources.sh
executable file
·32 lines (22 loc) · 1.19 KB
/
deploy_resources.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
if [ -z "$PROJECT_ID" ]; then
PROJECT_ID=$(gcloud info --format='value(config.project)')
fi
if [ -z "$PROJECT_ID" ]; then
echo "Please set PROJECT_ID env var."
exit 1
fi
export PROJECT_ID
# Create application 'workshop'
~/spin application save --file ~/canary-workshop/templates/workshop_application.json
# Create pipeline 'Bootstrap' in application 'workshop'
envsubst < ~/canary-workshop/templates/bootstrap_template.json | ~/spin pipeline save
# Run pipeline 'Bootstrap'
~/spin pipeline execute --application workshop --name Bootstrap
# Create pipeline 'Deploy Canary' in application 'workshop'
envsubst < ~/canary-workshop/templates/deploy_canary_template.json | ~/spin pipeline save
export DEPLOY_CANARY_REF=$(~/spin pipeline get --name 'Deploy Canary' --application workshop | jq .id)
# Create pipeline 'Promote Canary' in application 'workshop'
envsubst < ~/canary-workshop/templates/promote_canary_template.json | ~/spin pipeline save
export PROMOTE_CANARY_REF=$(~/spin pipeline get --name 'Promote Canary' --application workshop | jq .id)
# Create pipeline 'Clean Up Canary' in application 'workshop'
envsubst < ~/canary-workshop/templates/clean_up_canary_template.json | ~/spin pipeline save