-
Notifications
You must be signed in to change notification settings - Fork 3
/
cloudbuild.yaml
28 lines (28 loc) · 979 Bytes
/
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
steps:
- id: prepare-master-key
name: gcr.io/cloud-builders/gcloud
entrypoint: 'bash'
args: [ '-c', 'gcloud secrets versions access latest --secret=${_MASTER_KEY_ID} > config/master.key' ]
- id: deploy
name: 'gcr.io/cloud-builders/gcloud'
args: ['app', 'deploy']
waitFor:
- prepare-master-key
- id: prepare-gcp-sa-key
name: gcr.io/cloud-builders/gcloud
entrypoint: 'bash'
args: [ '-c', 'gcloud secrets versions access latest --secret=${_DEPLOY_SA_KEY_ID} > GCP_SA_KEY.json' ]
waitFor:
- deploy
- id: build
name: 'gcr.io/cloud-builders/docker'
args: ['build', '--build-arg', 'PROJECT_ID=$PROJECT_ID', '-f', 'Dockerfile.dbmigrate', '-t', 'gcr.io/$PROJECT_ID/${_MIGRATION_IMAGE}', '.']
waitFor:
- prepare-master-key
- prepare-gcp-sa-key
- id: migration
name: 'gcr.io/cloud-builders/docker'
args: ['run', 'gcr.io/$PROJECT_ID/${_MIGRATION_IMAGE}']
waitFor:
- build
timeout: 1800s