-
Notifications
You must be signed in to change notification settings - Fork 1
/
cloudbuild.yaml
32 lines (29 loc) · 977 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
32
options:
substitutionOption: "ALLOW_LOOSE"
substitutions:
_TAG: develop
_IMAGE_NAME: panoptes-data-explorer
_REPO_URL: https://github.com/panoptes/www.panoptes-data.net
steps:
# Fetch the repo from github
- name: gcr.io/cloud-builders/git
id: "clone-repo"
args: [ "clone", "${_REPO_URL}" ]
waitFor: [ "-" ]
# Pull the cached image.
- name: 'gcr.io/cloud-builders/docker'
id: "pull-cached-image"
entrypoint: 'bash'
args: [ '-c', 'docker pull gcr.io/${PROJECT_ID}/${_IMAGE_NAME}:${_TAG} || exit 0' ]
waitFor: [ "-" ]
# Build with cloned panoptes-utils as source directory
- name: "gcr.io/cloud-builders/docker"
id: "build-images"
args:
- "build"
- "--tag=gcr.io/${PROJECT_ID}/${_IMAGE_NAME}:${_TAG}"
- "--cache-from=gcr.io/${PROJECT_ID}/${_IMAGE_NAME}:${_TAG}"
- "www.panoptes-data.net"
waitFor: [ "clone-repo", "pull-cached-image" ]
images:
- "gcr.io/${PROJECT_ID}/${_IMAGE_NAME}:${_TAG}"