Skip to content

Commit ea4736d

Browse files
authored
Merge pull request #34091 from cpanato/updates-image
push the image when running the post cloudbuild job
2 parents 638a62e + eccf911 commit ea4736d

File tree

2 files changed

+10
-4
lines changed

2 files changed

+10
-4
lines changed

Makefile

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,9 @@ container-image: ## Build a container image for the preview of the website
7171
--tag $(CONTAINER_IMAGE) \
7272
--build-arg HUGO_VERSION=$(HUGO_VERSION)
7373

74+
container-push: container-image ## Push container image for the preview of the website
75+
$(CONTAINER_ENGINE) push $(CONTAINER_IMAGE)
76+
7477
container-build: module-check
7578
$(CONTAINER_RUN) --read-only --mount type=tmpfs,destination=/tmp,tmpfs-mode=01777 $(CONTAINER_IMAGE) sh -c "npm ci && hugo --minify --environment development"
7679

cloudbuild.yaml

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,17 +9,20 @@ options:
99
steps:
1010
# It's fine to bump the tag to a recent version, as needed
1111
- name: "gcr.io/k8s-staging-test-infra/gcb-docker-gcloud:v20210917-12df099d55"
12-
entrypoint: make
12+
entrypoint: 'bash'
1313
env:
1414
- DOCKER_CLI_EXPERIMENTAL=enabled
1515
- TAG=$_GIT_TAG
1616
- BASE_REF=$_PULL_BASE_REF
1717
args:
18-
- container-image
18+
- -c
19+
- |
20+
gcloud auth configure-docker \
21+
&& make container-push
1922
substitutions:
2023
# _GIT_TAG will be filled with a git-based tag for the image, of the form vYYYYMMDD-hash, and
2124
# can be used as a substitution
2225
_GIT_TAG: "12345"
2326
# _PULL_BASE_REF will contain the ref that was pushed to to trigger this build -
24-
# a branch like 'master' or 'release-0.2', or a tag like 'v0.2'.
25-
_PULL_BASE_REF: "master"
27+
# a branch like 'main' or 'release-0.2', or a tag like 'v0.2'.
28+
_PULL_BASE_REF: "main"

0 commit comments

Comments
 (0)