Skip to content

Commit

Permalink
Review comments
Browse files Browse the repository at this point in the history
  • Loading branch information
ambiknai committed Sep 15, 2021
1 parent eb8c7ce commit f8a2939
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 14 deletions.
22 changes: 8 additions & 14 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ CORE_DRIVER_IMG ?= $(REGISTRY)/$(CORE_IMAGE_NAME)

TAG ?= dev
ARCH ?= amd64
ALL_ARCH ?= amd64
ALL_ARCH ?= ppc64le



Expand Down Expand Up @@ -101,7 +101,7 @@ buildimage: build-systemutil
--build-arg jenkins_build_number=${BUILD_NUMBER} \
--build-arg REPO_SOURCE_URL=${REPO_SOURCE_URL} \
--build-arg BUILD_URL=${BUILD_URL} \
-t $(CORE_DRIVER_IMG)-$(ARCH):$(TAG) -f Dockerfile .
-t $(CORE_DRIVER_IMG):$(ARCH)-$(TAG) -f Dockerfile .

.PHONY: build-systemutil
build-systemutil:
Expand All @@ -123,17 +123,11 @@ clean:
## --------------------------------------

.PHONY: docker-build
docker-build: docker-pull-prerequisites buildimage ## Build the docker image for ibm-vpc-block-csi-driver
docker-build: buildimage ## Build the docker image for ibm-vpc-block-csi-driver

.PHONY: docker-push
docker-push: ## Push the docker image
docker push $(CORE_DRIVER_IMG)-$(ARCH):$(TAG)

.PHONY: docker-pull-prerequisites
docker-pull-prerequisites:
docker pull docker.io/docker/dockerfile:1.1-experimental
docker pull docker.io/library/golang:$(GOLANG_VERSION)
docker pull gcr.io/distroless/static:latest
docker push $(CORE_DRIVER_IMG):$(ARCH)-$(TAG)

## --------------------------------------
## Docker - All ARCH
Expand All @@ -159,16 +153,16 @@ docker-push-core-manifest: ## Push the fat manifest docker image.

.PHONY: docker-push-manifest
docker-push-manifest:
docker manifest create --amend $(DRIVER_IMG):$(TAG) $(shell echo $(ALL_ARCH) | sed -e "s~[^ ]*~$(DRIVER_IMG)\-&:$(TAG)~g")
@for arch in $(ALL_ARCH); do docker manifest annotate --arch $${arch} ${DRIVER_IMG}:${TAG} ${DRIVER_IMG}-$${arch}:${TAG}; done
docker manifest create --amend $(DRIVER_IMG):$(TAG) $(shell echo $(ALL_ARCH) | sed -e "s~[^ ]*~$(DRIVER_IMG):&-$(TAG)~g")
@for arch in $(ALL_ARCH); do docker manifest annotate --arch $${arch} ${DRIVER_IMG}:${TAG} ${DRIVER_IMG}:$${arch}-${TAG}; done
docker manifest push --purge ${DRIVER_IMG}:${TAG}

## --------------------------------------
## Release
## --------------------------------------

.PHONY: release-alias-tag # Adds the tag to the last build taggcloud container images add-tag -q $(CORE_DRIVER_IMG):$(TAG) $(CORE_DRIVER_IMG):$(RELEASE_ALIAS_TAG)
release-alias-tag:
.PHONY: release-alias-tag
release-alias-tag: # Adds the tag to the last build tag.
gcloud container images add-tag -q $(CORE_DRIVER_IMG):$(TAG) $(CORE_DRIVER_IMG):$(RELEASE_ALIAS_TAG)

.PHONY: release-staging
Expand Down
18 changes: 18 additions & 0 deletions cloudbuild.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# See https://cloud.google.com/cloud-build/docs/build-config
timeout: 3000s
options:
substitution_option: ALLOW_LOOSE
steps:
- name: 'gcr.io/k8s-testimages/gcb-docker-gcloud:v20210722-085d930'
entrypoint: make
env:
- DOCKER_CLI_EXPERIMENTAL=enabled
- TAG=$_GIT_TAG
- PULL_BASE_REF=$_PULL_BASE_REF
args:
- release-staging
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: 'dev'

0 comments on commit f8a2939

Please sign in to comment.