diff options
author | 2017-12-21 15:34:19 +0000 | |
---|---|---|
committer | 2017-12-21 10:34:19 -0500 | |
commit | 0221f3d83cf81563573c5d0c83ef700a89e13fb2 (patch) | |
tree | 34e61da52bbc90158d8e7865f29bfc8c2ab5b5f4 /Makefile.release | |
parent | a8ba24fff924d6206f2e24ba843d059018bc6dd0 (diff) | |
download | coredns-0221f3d83cf81563573c5d0c83ef700a89e13fb2.tar.gz coredns-0221f3d83cf81563573c5d0c83ef700a89e13fb2.tar.zst coredns-0221f3d83cf81563573c5d0c83ef700a89e13fb2.zip |
Makefile.release: allow for other docker registries (#1324)
Default to empty DOCKER var so you wont accidently push to the
production dockerhub. But allow to be overriden to you can push
to your registry. This allows you to re-use the CoreDNS makefiles for
your internal CI/CD.
Hacked Makefile with echos:
make DOCKER=bla -f Makefile.release docker-push
Pushing: 1.0.1
for arch in amd64 arm arm64 ppc64le s390x; do \
echo docker push bla/coredns:coredns-$arch ;\
done
docker push bla/coredns:coredns-amd64
docker push bla/coredns:coredns-arm
docker push bla/coredns:coredns-arm64
docker push bla/coredns:coredns-ppc64le
docker push bla/coredns:coredns-s390x
echo manifest-tool push from-args --platforms linux/amd64,linux/arm,linux/arm64,linux/ppc64le,linux/s390x --template bla/coredns:coredns-ARCH --target bla/coredns:1.0.1
manifest-tool push from-args --platforms linux/amd64,linux/arm,linux/arm64,linux/ppc64le,linux/s390x --template bla/coredns:coredns-ARCH --target bla/coredns:1.0.1
echo manifest-tool push from-args --platforms linux/amd64,linux/arm,linux/arm64,linux/ppc64le,linux/s390x --template bla/coredns:coredns-ARCH --target bla/coredns:latest
manifest-tool push from-args --platforms linux/amd64,linux/arm,linux/arm64,linux/ppc64le,linux/s390x --template bla/coredns:coredns-ARCH --target bla/coredns:latest
Diffstat (limited to 'Makefile.release')
-rw-r--r-- | Makefile.release | 29 |
1 files changed, 18 insertions, 11 deletions
diff --git a/Makefile.release b/Makefile.release index 496b87cdc..8d022fddb 100644 --- a/Makefile.release +++ b/Makefile.release @@ -32,13 +32,16 @@ # * We use the manifest-tool from https://github.com/estesp/manifest-tool to build the manifest list # * Make sure you have the binary in your path. # -# * Run: make -f Makefile.release docker +# * Run: make DOKCKER=coredns -f Makefile.release docker # -# Docker push should happen after you make the new release and uploaded it to -# Github. -EMPTY := -SPACE := $(EMPTY) $(EMPTY) -COMMA := $(EMPTY),$(EMPTY) +# Docker push should happen after you make the new release and uploaded it to Github. +# +# If you want to push to a personal registry, point DOCKER to something else, i.e. +# +# * make DOCKER=miek -f Makefile.release docker +EMPTY:= +SPACE:=$(EMPTY) $(EMPTY) +COMMA:=$(EMPTY),$(EMPTY) ifeq (, $(shell which gh-release)) $(error "No gh-release in $$PATH, install with: go get github.com/progrium/gh-release") @@ -48,21 +51,25 @@ ifeq (, $(shell which manifest-tool)) $(error "No manifest-tool in $$PATH, install with: go get github.com/estesp/manifest-tool") endif +DOCKER:= NAME:=coredns VERSION:=$(shell grep 'coreVersion' coremain/version.go | awk '{ print $$3 }' | tr -d '"') GITHUB:=coredns -DOCKER:=coredns DOCKER_IMAGE_NAME:=$(DOCKER)/$(NAME) GITCOMMIT:=$(shell git describe --dirty --always) LINUX_ARCH:=amd64 arm arm64 ppc64le s390x PLATFORMS:=$(subst $(SPACE),$(COMMA),$(foreach arch,$(LINUX_ARCH),linux/$(arch))) +ifeq ($(DOCKER),) + $(error "Please specify Docker registry to use. Use \"coredns\" for releases") +endif + all: @echo Use the 'release' target to start a release release: commit push build tar upload -docker: docker-build docker-upload +docker: docker-build docker-push .PHONY: push push: @@ -136,9 +143,9 @@ docker-build: tar docker tag coredns $(DOCKER_IMAGE_NAME):coredns-$$arch ;\ done -.PHONY: docker-upload -docker-upload: - @echo Pushing: $(VERSION) +.PHONY: docker-push +docker-push: + @echo Pushing: $(VERSION) to $(DOCKER_IMAGE_NAME) for arch in $(LINUX_ARCH); do \ docker push $(DOCKER_IMAGE_NAME):coredns-$$arch ;\ done |