-
Notifications
You must be signed in to change notification settings - Fork 17
/
cloudbuild.yaml
48 lines (42 loc) · 1.17 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
steps:
# Pull most recent Docker image.
- id: 'pull-image'
name: 'gcr.io/cloud-builders/docker'
args: ['pull', '${_DOCKER_IMAGE}']
waitFor: ['-']
# Build the new Docker image (caching from the pre-built one)
- id: 'build-image'
waitFor: ['pull-image']
name: 'gcr.io/cloud-builders/docker'
args: [
'build',
'--network=cloudbuild',
'--cache-from=${_DOCKER_IMAGE}',
'--tag=${_DOCKER_IMAGE}',
'.',
]
# Push updated Docker image to Container Registry.
- id: 'push-image'
waitFor: ['build-image']
name: 'gcr.io/cloud-builders/docker'
args: [
'push',
'${_DOCKER_IMAGE}',
]
# Run presubmit tests.
- id: 'presubmit'
secretEnv: ['GITHUB_COMMIT_STATUS_TOKEN']
waitFor: ['build-image']
name: '${_DOCKER_IMAGE}'
entrypoint: 'bash'
args: ['./gcb/presubmit.sh']
env:
- 'REPO_NAME=${REPO_NAME}'
- 'COMMIT_SHA=${COMMIT_SHA}'
timeout: 3600s # 60 mins, just in case.
substitutions:
_DOCKER_IMAGE: us-central1-docker.pkg.dev/google.com/raksha-ci/gcb-docker-images/gcb:latest
availableSecrets:
secretManager:
- versionName: projects/353460796050/secrets/raksha-ci-commit-status-token/versions/latest
env: 'GITHUB_COMMIT_STATUS_TOKEN'