-
Notifications
You must be signed in to change notification settings - Fork 10
/
cloudbuild.yaml
56 lines (47 loc) · 1.51 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
# using default substitutions, provided by Google Cloud Build
# see: https://cloud.google.com/container-builder/docs/configuring-builds/substitute-variable-values#using_default_substitutions
steps:
# Build and tag skaffold-deps image using docker with cache-from
- name: 'gcr.io/cloud-builders/docker'
args:
- 'build'
- '-t'
- 'gcr.io/$PROJECT_ID/build_deps:latest'
- '--cache-from'
- 'gcr.io/k8s-skaffold/build_deps:latest'
- '-f'
- 'deploy/skaffold/Dockerfile.deps'
- '.'
- name: 'gcr.io/cloud-builders/docker'
args: ['build', '-t', 'gcr.io/$PROJECT_ID/myimage:latest', '.']
# Grab secret credentials from gcp bucket
- name: gcr.io/cloud-builders/gcloud
entrypoint: 'bash'
args: ['deploy/setup-secret.sh','-p', $PROJECT_ID]
# Build and tag skaffold builder
- name: 'gcr.io/cloud-builders/docker'
args:
- 'build'
- '-t'
- 'gcr.io/$PROJECT_ID/skaffold-builder:latest'
- '-f'
- 'deploy/skaffold/Dockerfile'
- '.'
# Do the go build & push the results to GCS
- name: 'gcr.io/$PROJECT_ID/skaffold-builder:latest'
args:
- 'make'
- 'release-build'
- 'RELEASE_BUCKET=$_RELEASE_BUCKET'
- 'GCP_PROJECT=$PROJECT_ID'
# Check that skaffold is in the image
- name: 'gcr.io/$PROJECT_ID/skaffold:edge'
args:
- 'skaffold'
- 'version'
images:
- 'gcr.io/$PROJECT_ID/skaffold:edge'
- 'gcr.io/$PROJECT_ID/skaffold:$COMMIT_SHA'
options:
machineType: 'N1_HIGHCPU_8'
timeout: 1500s