Skip to content

Commit 304bf1b

Browse files
authored
Merge pull request #24387 from ameukam/container-image-build-automation
Add Container image build automation
2 parents aa0890d + 5eadf77 commit 304bf1b

File tree

2 files changed

+26
-1
lines changed

2 files changed

+26
-1
lines changed

Makefile

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,9 @@ NETLIFY_FUNC = $(NODE_BIN)/netlify-lambda
66
# but this can be overridden when calling make, e.g.
77
# CONTAINER_ENGINE=podman make container-image
88
CONTAINER_ENGINE ?= docker
9+
IMAGE_REGISTRY ?= gcr.io/k8s-staging-sig-docs
910
IMAGE_VERSION=$(shell scripts/hash-files.sh Dockerfile Makefile | cut -c 1-12)
10-
CONTAINER_IMAGE = kubernetes-hugo:v$(HUGO_VERSION)-$(IMAGE_VERSION)
11+
CONTAINER_IMAGE = $(IMAGE_REGISTRY)/k8s-website-hugo:v$(HUGO_VERSION)-$(IMAGE_VERSION)
1112
CONTAINER_RUN = $(CONTAINER_ENGINE) run --rm --interactive --tty --volume $(CURDIR):/src
1213

1314
CCRED=\033[0;31m

cloudbuild.yaml

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
# See https://cloud.google.com/cloud-build/docs/build-config
2+
3+
# this must be specified in seconds. If omitted, defaults to 600s (10 mins)
4+
timeout: 1200s
5+
# this prevents errors if you don't use both _GIT_TAG and _PULL_BASE_REF,
6+
# or any new substitutions added in the future.
7+
options:
8+
substitution_option: ALLOW_LOOSE
9+
steps:
10+
- name: "gcr.io/k8s-testimages/gcb-docker-gcloud:v20190906-745fed4"
11+
entrypoint: make
12+
env:
13+
- DOCKER_CLI_EXPERIMENTAL=enabled
14+
- TAG=$_GIT_TAG
15+
- BASE_REF=$_PULL_BASE_REF
16+
args:
17+
- container-image
18+
substitutions:
19+
# _GIT_TAG will be filled with a git-based tag for the image, of the form vYYYYMMDD-hash, and
20+
# can be used as a substitution
21+
_GIT_TAG: "12345"
22+
# _PULL_BASE_REF will contain the ref that was pushed to to trigger this build -
23+
# a branch like 'master' or 'release-0.2', or a tag like 'v0.2'.
24+
_PULL_BASE_REF: "master"

0 commit comments

Comments
 (0)