-
-
Notifications
You must be signed in to change notification settings - Fork 1
/
cloudbuild.yaml
31 lines (28 loc) · 940 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
29
30
31
steps:
- name: 'gcr.io/cloud-builders/gsutil'
args: ['cp', '-r', 'gs://sentry-ml/seer/models/*', './models']
- name: 'gcr.io/cloud-builders/docker'
args: [
'build',
'-t', 'us-central1-docker.pkg.dev/$PROJECT_ID/seer/image:$COMMIT_SHA',
'-t', 'us-central1-docker.pkg.dev/$PROJECT_ID/seer/image:latest',
'--build-arg',
'BUILDKIT_INLINE_CACHE=1',
'--build-arg',
'SEER_VERSION_SHA=$COMMIT_SHA',
'--cache-from', 'us-central1-docker.pkg.dev/$PROJECT_ID/seer/image:latest',
'.',
]
env: [DOCKER_BUILDKIT=1]
- name: 'gcr.io/cloud-builders/docker'
entrypoint: 'bash'
args:
- '-c'
- |
# Only push "latest" tag when building on "main"
[ "$BRANCH_NAME" != "main" ] && exit 0
docker push us-central1-docker.pkg.dev/$PROJECT_ID/seer/image:latest
# This is needed for Freight to find matching builds
images: [
'us-central1-docker.pkg.dev/$PROJECT_ID/seer/image:$COMMIT_SHA',
]