Skip to content

Commit

Permalink
Uses Artifact Registry build images (#7)
Browse files Browse the repository at this point in the history
* Uses Artifact Registry build images

And the name of the build image is stored as a user-defined substitution
variable in the build trigger in each project. This is because the flow for
this repo is mlab-sandbox -> mlab-staging -> measurement-lab, but the build
images are not present in the measurement-lab project. That project uses the
mlab-oti image, since both are production projects.

* Substitutes _only_ the image project

Rather than substituting the entire build image path, this commit changes that
to only substitute the project of the build image to make it more transparent
in the code what is being run.
  • Loading branch information
nkinkade authored Mar 14, 2024
1 parent 48c47a9 commit 54da76e
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions cloudbuild.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,17 @@ 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.
#
# Deploy public Grafana instance in AppEngine
steps:
- name: gcr.io/$PROJECT_ID/gcloud-jsonnet-cbif:1.18
- name: us-central1-docker.pkg.dev/${_IMAGE_PROJECT}/build-images/gcloud-jsonnet-cbif:1.1
entrypoint: /bin/bash
args:
- -c
Expand All @@ -15,7 +23,7 @@ steps:
-e 's|{{PROJECT_ID}}|${PROJECT_ID}|' \
grafana-public/app.yaml.template > \
grafana-public/app.yaml
- name: gcr.io/$PROJECT_ID/gcloud-jsonnet-cbif:1.18
- name: us-central1-docker.pkg.dev/${_IMAGE_PROJECT}/build-images/gcloud-jsonnet-cbif:1.1
env:
- PROJECT_IN=mlab-sandbox,mlab-staging,measurement-lab
args:
Expand Down

0 comments on commit 54da76e

Please sign in to comment.