-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcloudbuild.rpc.yaml
32 lines (31 loc) · 1.11 KB
/
cloudbuild.rpc.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
# https://cloud.google.com/cloud-build/docs/speeding-up-builds
# https://cloud.google.com/cloud-build/docs/configuring-builds/substitute-variable-values
substitutions:
_IMAGE: 'gcr.io/wb-genesis/cpp_base'
timeout: '30m'
steps:
# allow these steps to fail, they try to pull cache first
#- name: 'gcr.io/cloud-builders/docker'
#entrypoint: 'bash'
#args: ['-c', 'docker pull $_IMAGE:$BRANCH_NAME || true' ]
# build final docker image
- name: 'gcr.io/cloud-builders/docker'
args: [
'build',
'-f', 'rpc.Dockerfile',
'-t', '$_IMAGE:$BRANCH_NAME',
'-t', '$_IMAGE:$COMMIT_SHA',
'-t', '$_IMAGE:rpc',
#'--cache-from', '$_IMAGE:$BRANCH_NAME',
'.'
]
# push docker image tag(s) one branch, one immutable
- name: 'gcr.io/cloud-builders/docker'
args: [ 'push', '$_IMAGE:$COMMIT_SHA' ]
- name: 'gcr.io/cloud-builders/docker'
args: [ 'push', '$_IMAGE:$BRANCH_NAME' ]
- name: 'gcr.io/cloud-builders/docker'
args: [ 'push', '$_IMAGE:rpc' ]
options:
machineType: 'N1_HIGHCPU_32'
images: [ '$_IMAGE:$COMMIT_SHA', '$_IMAGE:$BRANCH_NAME','$_IMAGE:rpc']