-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcloudbuild.yaml
40 lines (34 loc) · 1.49 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
timeout: 3600s
options:
env:
- PROJECT_ID=$PROJECT_ID
# We have $_IMAGE_PROJECT in a Cloud Build user-defined substitution variable
# because this build gets run in more projects that just the standard
# sandbox->staging->prod, but those projects are the only ones where the
# container images are built and pushed to Artifact Registry. The other
# production project where this build will happen is "measurement-lab", which
# is a production project, so we want to use the "mlab-oti" (prod) image. The
# value of this variable is defined in the build trigger of each project.
# Evaluate the app.yaml.template file
steps:
- name: us-central1-docker.pkg.dev/${_IMAGE_PROJECT}/build-images/gcloud-jsonnet-cbif:1.1
entrypoint: /bin/bash
args:
- -c
- |-
sed -e 's|{{SERVER_ROOT_URL}}|${_SERVER_ROOT_URL}|' \
-e 's|{{PROJECT_ID}}|${PROJECT_ID}|' \
grafana-public/app.yaml.template > \
grafana-public/app.yaml
# Deploy public Grafana instance in AppEngine in sandbox and staging
- name: us-central1-docker.pkg.dev/${_IMAGE_PROJECT}/build-images/gcloud-jsonnet-cbif:1.1
env:
- PROJECT_IN=mlab-sandbox,mlab-staging
args:
- gcloud app deploy grafana-public/app.yaml --project $PROJECT_ID
# Deploy public Grafana instance in AppEngine in production
- name: us-central1-docker.pkg.dev/${_IMAGE_PROJECT}/build-images/gcloud-jsonnet-cbif:1.1
env:
- PROJECT_IN=measurement-lab
args:
- gcloud app deploy grafana-public/app.yaml grafana-public/dispatch.yaml --project $PROJECT_ID