-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcloudbuild.yaml
38 lines (33 loc) · 1.43 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
# Cloud Build configuration for clinvar-streams
#
# Command line test usage:
# gcloud builds submit --project=clingen-stage --config ./cloudbuild.yaml \
# --substitutions=COMMIT_SHA="testbuild" .
steps:
# build code (we could cache this image as well, by pulling, and pushing at end)
- name: 'gcr.io/cloud-builders/docker'
args: [ 'build', '.',
'-f', 'docker/clinvar-streams.Dockerfile',
'--target', 'builder',
'-t', 'gcr.io/$PROJECT_ID/clinvar-streams-builder:latest' ]
# run tests in code builder image
- name: 'gcr.io/cloud-builders/docker'
args: [ 'run',
'gcr.io/$PROJECT_ID/clinvar-streams-builder:latest',
'lein', 'test' ]
# Build release image, using builder image as cache
- name: 'gcr.io/cloud-builders/docker'
args: [ 'build', '.',
'-f', 'docker/clinvar-streams.Dockerfile',
'-t', 'gcr.io/$PROJECT_ID/clinvar-streams:$COMMIT_SHA',
'-t', 'gcr.io/$PROJECT_ID/clinvar-streams:latest',
'--cache-from', 'gcr.io/$PROJECT_ID/clinvar-streams-builder:latest' ]
# push the images
# The builder image is not pushed, because is will almost certainly
# change any time a file change occurs in the source tree, so it is
# not useful to cache it in the registry.
images:
- 'gcr.io/$PROJECT_ID/clinvar-streams:$COMMIT_SHA'
- 'gcr.io/$PROJECT_ID/clinvar-streams:latest'
# timeout if not complete in 30 minutes
timeout: 1800s