aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGravatar Miek Gieben <miek@miek.nl> 2017-03-01 15:46:26 +0000
committerGravatar GitHub <noreply@github.com> 2017-03-01 15:46:26 +0000
commita3f7788686a3833677b5c86da90d70604637d307 (patch)
tree5244f02c7f738282388646116f2a1cbb6a9d8ef4
parent9ea8cde36e24cb68d6cb2c5db7b6b08e204db7a8 (diff)
downloadcoredns-a3f7788686a3833677b5c86da90d70604637d307.tar.gz
coredns-a3f7788686a3833677b5c86da90d70604637d307.tar.zst
coredns-a3f7788686a3833677b5c86da90d70604637d307.zip
Put docker release in Makefile.release (#562)
Make the docker release part of the normal CoreDNS release
-rw-r--r--Makefile9
-rw-r--r--Makefile.release21
2 files changed, 21 insertions, 9 deletions
diff --git a/Makefile b/Makefile
index ecd690786..75bc40d2c 100644
--- a/Makefile
+++ b/Makefile
@@ -2,9 +2,6 @@ BUILD_VERBOSE := -v
TEST_VERBOSE := -v
-DOCKER_IMAGE_NAME ?= $$USER/coredns
-DOCKER_VERSION ?= $(shell grep 'coreVersion' coremain/version.go | awk '{ print $$3 }' | tr -d '"')
-
all: coredns
# Phony this to ensure we always build the binary.
@@ -13,12 +10,6 @@ all: coredns
coredns: deps core/zmiddleware.go core/dnsserver/zdirectives.go
go build $(BUILD_VERBOSE) -ldflags="-s -w"
-.PHONY: docker
-docker: deps
- CGO_ENABLED=0 GOOS=linux go build -ldflags="-s -w"
- docker build -t $(DOCKER_IMAGE_NAME) .
- docker tag $(DOCKER_IMAGE_NAME):latest $(DOCKER_IMAGE_NAME):$(DOCKER_VERSION)
-
.PHONY: deps
deps: fmt
go get ${BUILD_VERBOSE}
diff --git a/Makefile.release b/Makefile.release
index 61f5e7ca9..a9835c081 100644
--- a/Makefile.release
+++ b/Makefile.release
@@ -24,14 +24,24 @@
# * will commit your change with 'Release $VERSION'
# * push to github
# * build the release and do all that fluff.
+#
+# Steps for docker
+# * Login into docker: docker login (should have push creds for coredns registry)
+# * Run: make -f Makefile.release docker
+#
+# Docker push should happen after you make the new release and uploaded it to Github.
NAME:=coredns
VERSION:=$(shell grep 'coreVersion' coremain/version.go | awk '{ print $$3 }' | tr -d '"')
ARCH:=$(shell uname -m)
GITHUB:=coredns
+DOCKER:=coredns
+DOCKER_IMAGE_NAME:=$(DOCKER)/$(NAME)
all: commit push build tar release
+docker: docker-build docker-release
+
.PHONY: push
push:
@echo Pushing release to master
@@ -62,6 +72,17 @@ release:
@echo Releasing: $(VERSION)
gh-release create $(GITHUB)/$(NAME) $(VERSION)
+.PHONY: docker-build
+docker:
+ CGO_ENABLED=0 GOOS=linux go build -ldflags="-s -w"
+ docker build -t $(DOCKER_IMAGE_NAME) .
+ docker tag $(DOCKER_IMAGE_NAME):latest $(DOCKER_IMAGE_NAME):$(VERSION)
+
+.PHONY: docker-release
+docker-release:
+ @echo Pushing: $(VERSION)
+ docker tag $(DOCKER_IMAGE_NAME):latest $(DOCKER_IMAGE_NAME):$(VERSION)
+
.PHONY: clean
clean:
rm -rf release