forked from eritislami/evobot
-
Notifications
You must be signed in to change notification settings - Fork 0
/
cloudbuild.yaml
20 lines (20 loc) · 1.04 KB
/
cloudbuild.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
steps:
- name: 'gcr.io/cloud-builders/gcloud'
entrypoint: 'bash'
args: [ '-c', "gcloud secrets versions access latest --secret=${_SECRET_NAME} --format='get(payload.data)' | tr '_-' '/+' | base64 -d > config.json"]
- name: 'gcr.io/cloud-builders/docker'
entrypoint: 'bash'
args: ['-c', 'docker pull gcr.io/$PROJECT_ID/evobot:latest || exit 0']
- name: 'gcr.io/cloud-builders/docker'
args: ['build',
'-t', 'gcr.io/$PROJECT_ID/evobot:$SHORT_SHA',
'-t', 'gcr.io/$PROJECT_ID/evobot:latest',
'--cache-from', 'gcr.io/$PROJECT_ID/evobot:latest',
'.']
- name: 'gcr.io/cloud-builders/docker'
args: ['push', 'gcr.io/$PROJECT_ID/evobot:$SHORT_SHA']
- name: 'gcr.io/cloud-builders/docker'
args: ['push', 'gcr.io/$PROJECT_ID/evobot:latest']
- name: 'gcr.io/cloud-builders/gcloud'
args: ['compute', 'instances', 'update-container', '${_INSTANCE_NAME}', '--zone', '${_ZONE}',
'--container-image', 'gcr.io/$PROJECT_ID/evobot:$SHORT_SHA', '--container-env', 'FRED_VERSION=$SHORT_SHA']