-
Notifications
You must be signed in to change notification settings - Fork 1
/
cloudbuild.yaml
62 lines (56 loc) · 1.9 KB
/
cloudbuild.yaml
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
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
steps:
- id: install
name: 'gcr.io/cloud-builders/npm:node-16.18.0'
entrypoint: 'npm'
args: ['install']
- id: test
name: 'gcr.io/cloud-builders/npm:node-16.18.0'
waitFor: ['install']
entrypoint: 'npm'
args: ['run', 'test']
- id: build
name: 'gcr.io/cloud-builders/npm:node-16.18.0'
waitFor: ['test']
entrypoint: 'npm'
args: ['run', 'build']
secretEnv: ['VUE_APP_TARGOMO_REGION', VUE_APP_TARGOMO_SERVICE_KEY]
- id: deploy
waitFor: ['build']
name: 'gcr.io/cloud-builders/gsutil'
entrypoint: 'gsutil'
args:
- '-m'
- 'rsync'
- '-r'
- 'dist/'
- 'gs://ann-radar-develop'
- id: setmeta
waitFor: ['deploy']
name: 'gcr.io/cloud-builders/gsutil'
entrypoint: 'gsutil'
args:
[
'-m',
'setmeta',
'-r',
'-h',
'Cache-Control: no-cache',
'gs://ann-radar-develop/*'
]
- id: slack_notification
waitFor: ['setmeta']
name: gcr.io/cloud-builders/curl
entrypoint: 'bash'
args:
- -c
- |
curl -X POST -H "Content-type: application/json; charset=utf-8" -H "Authorization: Bearer $$SLACK_BOT_TOKEN" --data "{\"channel\":\"C02V2LH6LRM\",\"username\":\"Production Deployment\",\"icon_emoji\":\":robot_face:\",\"text\":\"New production version deployed: https://storage.googleapis.com/ann-radar-develop/index.html\",\"unfurl_links\":false}" https://slack.com/api/chat.postMessage
secretEnv: ['SLACK_BOT_TOKEN']
availableSecrets:
secretManager:
- versionName: projects/ann-radar-prototype-project/secrets/SLACK_BOT_TOKEN/versions/latest
env: 'SLACK_BOT_TOKEN'
- versionName: projects/ann-radar-prototype-project/secrets/TARGOMO_REGION/versions/latest
env: 'VUE_APP_TARGOMO_REGION'
- versionName: projects/ann-radar-prototype-project/secrets/TARGOMO_SERVICE_KEY/versions/latest
env: 'VUE_APP_TARGOMO_SERVICE_KEY'