From eccf91164c0bc552be0c4d70eaceda29a5684951 Mon Sep 17 00:00:00 2001 From: cpanato Date: Wed, 1 Jun 2022 09:43:32 +0200 Subject: [PATCH] push the image when running the post cloudbuild job Signed-off-by: cpanato --- Makefile | 3 +++ cloudbuild.yaml | 11 +++++++---- 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/Makefile b/Makefile index 57fca6e2d1ba4..e0569404d672e 100644 --- a/Makefile +++ b/Makefile @@ -71,6 +71,9 @@ container-image: ## Build a container image for the preview of the website --tag $(CONTAINER_IMAGE) \ --build-arg HUGO_VERSION=$(HUGO_VERSION) +container-push: container-image ## Push container image for the preview of the website + $(CONTAINER_ENGINE) push $(CONTAINER_IMAGE) + container-build: module-check $(CONTAINER_RUN) --read-only --mount type=tmpfs,destination=/tmp,tmpfs-mode=01777 $(CONTAINER_IMAGE) sh -c "npm ci && hugo --minify --environment development" diff --git a/cloudbuild.yaml b/cloudbuild.yaml index 5039818482f3d..542d58016c7e9 100644 --- a/cloudbuild.yaml +++ b/cloudbuild.yaml @@ -9,17 +9,20 @@ options: steps: # It's fine to bump the tag to a recent version, as needed - name: "gcr.io/k8s-staging-test-infra/gcb-docker-gcloud:v20210917-12df099d55" - entrypoint: make + entrypoint: 'bash' env: - DOCKER_CLI_EXPERIMENTAL=enabled - TAG=$_GIT_TAG - BASE_REF=$_PULL_BASE_REF args: - - container-image + - -c + - | + gcloud auth configure-docker \ + && make container-push substitutions: # _GIT_TAG will be filled with a git-based tag for the image, of the form vYYYYMMDD-hash, and # can be used as a substitution _GIT_TAG: "12345" # _PULL_BASE_REF will contain the ref that was pushed to to trigger this build - - # a branch like 'master' or 'release-0.2', or a tag like 'v0.2'. - _PULL_BASE_REF: "master" + # a branch like 'main' or 'release-0.2', or a tag like 'v0.2'. + _PULL_BASE_REF: "main"