Skip to content
This repository was archived by the owner on Jul 30, 2021. It is now read-only.

Commit 99b4332

Browse files
committed
Update Makefile
Signed-off-by: Chuck Ha <[email protected]>
1 parent e3b2bcf commit 99b4332

File tree

1 file changed

+9
-5
lines changed

1 file changed

+9
-5
lines changed

Makefile

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,10 @@ PULL_POLICY ?= Always
3232

3333
# Define Docker related variables. Releases should modify and double check these vars.
3434
REGISTRY ?= gcr.io/$(shell gcloud config get-value project)
35-
CONTROLLER_IMG ?= $(REGISTRY)/cluster-api-kubeadm-controller
35+
STAGING_REGISTRY := gcr.io/k8s-staging-capi-kubeadm
36+
PROD_REGISTRY := us.gcr.io/k8s-artifacts-prod/capi-kubeadm
37+
IMAGE_NAME ?= cluster-api-kubeadm-controller
38+
CONTROLLER_IMG ?= $(REGISTRY)/$(IMAGE_NAME)
3639
TAG ?= dev
3740
ARCH ?= amd64
3841
ALL_ARCH = amd64 arm arm64 ppc64le s390x
@@ -149,6 +152,7 @@ docker-push-manifest: ## Push the fat manifest docker image.
149152
## Minimum docker version 18.06.0 is required for creating and pushing manifest images.
150153
docker manifest create --amend $(CONTROLLER_IMG):$(TAG) $(shell echo $(ALL_ARCH) | sed -e "s~[^ ]*~$(CONTROLLER_IMG)\-&:$(TAG)~g")
151154
@for arch in $(ALL_ARCH); do docker manifest annotate --arch $${arch} ${CONTROLLER_IMG}:${TAG} ${CONTROLLER_IMG}-$${arch}:${TAG}; done
155+
docker manifest push --purge ${CONTROLLER_IMG}:${TAG}
152156
MANIFEST_IMG=$(CONTROLLER_IMG) MANIFEST_TAG=$(TAG) $(MAKE) set-manifest-image
153157

154158
.PHONY: set-manifest-image
@@ -166,16 +170,16 @@ RELEASE_TAG := $(shell git describe --abbrev=0 2>/dev/null)
166170
release: ## Builds and push container images using the latest git tag for the commit.
167171
@if [ -z "${RELEASE_TAG}" ]; then echo "RELEASE_TAG is not set"; exit 1; fi
168172
# Push the release image to the staging bucket first.
169-
REGISTRY=gcr.io/k8s-staging-capi-kubeadm TAG=$(RELEASE_TAG) \
173+
REGISTRY=$(STAGING_REGISTRY) TAG=$(RELEASE_TAG) \
170174
$(MAKE) docker-build-all docker-push-all
171175
# Set the manifest image to the production bucket.
172-
REGISTRY=us.gcr.io/k8s-artifacts-prod/capi-kubeadm TAG=$(RELEASE_TAG) \
173-
set-manifest-image
176+
MANIFEST_IMG=$(PROD_REGISTRY)/$(IMAGE_NAME) MANIFEST_TAG=$(RELEASE_TAG) \
177+
$(MAKE) set-manifest-image
174178
# Generate release artifacts.
175179
mkdir -p out/
176180
kustomize build config/default > out/bootstrap-components.yaml
177181

178182
.PHONY: release-staging-latest
179183
release-staging-latest: ## Builds and push container images to the staging bucket using "latest" tag.
180-
REGISTRY=gcr.io/k8s-staging-capi-kubeadm TAG=latest \
184+
REGISTRY=$(STAGING_REGISTRY) TAG=latest \
181185
$(MAKE) docker-build-all docker-push-all

0 commit comments

Comments
 (0)