2016-09-18 14:14:01 +01:00
|
|
|
# Makefile for releasing CoreDNS
|
|
|
|
|
#
|
2017-10-30 15:55:41 +00:00
|
|
|
# The release is controlled from coremain/version.go. The version found there is
|
|
|
|
|
# used to tag the git repo and to build the assets that are uploaded to github
|
|
|
|
|
# (after some sanity checks).
|
2017-08-13 09:41:50 -07:00
|
|
|
#
|
2017-10-30 15:55:41 +00:00
|
|
|
# The release should be accompanied by release notes published on coredns.io.
|
|
|
|
|
# For example: https://coredns.io/2016/09/18/coredns-001-release/ Also send an
|
|
|
|
|
# email to coredns-discuss@ to announce the new version.
|
2017-08-13 09:41:50 -07:00
|
|
|
#
|
2018-07-10 04:35:58 +01:00
|
|
|
# Getting the authors for this release is done with the following command line
|
|
|
|
|
# git log --pretty=format:'%an' v$(VERSION)..master | sort -u
|
Makefile: add Windows target (#1199)
While we at it, why not add a target for Windows as well.
This also introduces a VERBOSE option that defaults to -v, but it empty
when releases so that you can actually see what you're building.
Move an @echo out of shell snippet into the Makefile, as that errored
with @echo: command not found.
Sample run and resulting artifacts:
~~~
% make -f Makefile.release build
% find build -type f -exec file {} \;
build/windows/amd64/coredns: PE32+ executable (console) x86-64 (stripped to external PDB), for MS Windows
build/darwin/amd64/coredns: Mach-O 64-bit x86_64 executable, flags:<NOUNDEFS>
build/linux/ppc64le/coredns: ELF 64-bit LSB executable, 64-bit PowerPC or cisco 7500, version 1 (SYSV), statically linked, stripped
build/linux/amd64/coredns: ELF 64-bit LSB executable, x86-64, version 1 (SYSV), statically linked, stripped
build/linux/arm/coredns: ELF 32-bit LSB executable, ARM, EABI5 version 1 (SYSV), statically linked, stripped
build/linux/s390x/coredns: ELF 64-bit MSB executable, IBM S/390, version 1 (SYSV), statically linked, stripped
build/linux/arm64/coredns: ELF 64-bit LSB executable, ARM aarch64, version 1 (SYSV), statically linked, stripped
% make -f Makefile.release tar
% find release -type f | sort
release/coredns_0.9.9_darwin_amd64.tgz
release/coredns_0.9.9_linux_amd64.tgz
release/coredns_0.9.9_linux_arm64.tgz
release/coredns_0.9.9_linux_arm.tgz
release/coredns_0.9.9_linux_ppc64le.tgz
release/coredns_0.9.9_linux_s390x.tgz
release/coredns_0.9.9_windows_amd64.tgz
~~~
2017-11-03 13:45:13 +00:00
|
|
|
#
|
2016-09-18 14:14:01 +01:00
|
|
|
# Steps:
|
|
|
|
|
# * Up the version in coremain/version.go
|
2018-07-10 04:35:58 +01:00
|
|
|
# * Do a make -f Makefile.doc
|
|
|
|
|
# * go generate
|
|
|
|
|
# * Send PR to get this merged.
|
2017-07-24 08:24:53 -07:00
|
|
|
#
|
2018-07-10 04:35:58 +01:00
|
|
|
# * Open an issue for this release
|
2018-07-11 09:56:37 +01:00
|
|
|
# * In an issue give the command: /release: master
|
|
|
|
|
# * (to test as release /release: -t master can be used.
|
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
2017-12-21 15:34:19 +00:00
|
|
|
#
|
2018-07-11 09:56:37 +01:00
|
|
|
# See github.com/coredns/release for documentation README on what needs to be setup for this to be
|
|
|
|
|
# automated (can still be done by hand if needed). Especially what environment variables need to be
|
|
|
|
|
# set!
|
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
2017-12-21 15:34:19 +00:00
|
|
|
#
|
2018-07-11 09:56:37 +01:00
|
|
|
# To release we run, where 'release' and 'docker' only locally build assets; these are the same
|
|
|
|
|
# targets that get executed in case of testing.
|
2018-07-10 04:35:58 +01:00
|
|
|
# * make release
|
|
|
|
|
# * make github-push
|
|
|
|
|
# * make docker
|
|
|
|
|
# * make docker-push
|
|
|
|
|
|
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
2017-12-21 15:34:19 +00:00
|
|
|
EMPTY:=
|
|
|
|
|
SPACE:=$(EMPTY) $(EMPTY)
|
|
|
|
|
COMMA:=$(EMPTY),$(EMPTY)
|
2016-09-18 14:14:01 +01:00
|
|
|
|
2018-06-24 11:21:58 -07:00
|
|
|
ifeq (, $(shell which curl))
|
|
|
|
|
$(error "No curl in $$PATH, please install")
|
2017-09-15 09:56:20 +01:00
|
|
|
endif
|
|
|
|
|
|
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
2017-12-21 15:34:19 +00:00
|
|
|
DOCKER:=
|
2016-11-27 15:19:41 +00:00
|
|
|
NAME:=coredns
|
2018-01-23 21:10:55 +01:00
|
|
|
VERSION:=$(shell grep 'CoreVersion' coremain/version.go | awk '{ print $$3 }' | tr -d '"')
|
2017-02-21 20:02:43 +00:00
|
|
|
GITHUB:=coredns
|
2017-03-01 15:46:26 +00:00
|
|
|
DOCKER_IMAGE_NAME:=$(DOCKER)/$(NAME)
|
2017-11-04 00:41:35 -07:00
|
|
|
LINUX_ARCH:=amd64 arm arm64 ppc64le s390x
|
|
|
|
|
PLATFORMS:=$(subst $(SPACE),$(COMMA),$(foreach arch,$(LINUX_ARCH),linux/$(arch)))
|
2016-09-18 14:14:01 +01:00
|
|
|
|
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
2017-12-21 15:34:19 +00:00
|
|
|
ifeq ($(DOCKER),)
|
2018-01-26 16:57:08 +00:00
|
|
|
$(error "Please specify Docker registry to use. Use DOCKER=coredns for releases")
|
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
2017-12-21 15:34:19 +00:00
|
|
|
endif
|
|
|
|
|
|
2017-05-12 10:15:34 +01:00
|
|
|
all:
|
2018-07-10 04:35:58 +01:00
|
|
|
@echo Use the 'release' target to build a release, 'docker' for docker build.
|
2016-10-19 20:49:27 +01:00
|
|
|
|
2018-07-21 16:39:53 +01:00
|
|
|
release: pre build tar sum
|
2017-05-12 10:15:34 +01:00
|
|
|
|
2018-07-10 04:35:58 +01:00
|
|
|
docker: docker-build
|
2017-03-01 15:46:26 +00:00
|
|
|
|
2018-01-26 16:57:08 +00:00
|
|
|
.PHONY: pre
|
|
|
|
|
pre:
|
2018-07-10 04:35:58 +01:00
|
|
|
go get github.com/estesp/manifest-tool
|
2016-11-11 17:56:54 +00:00
|
|
|
|
2016-09-18 14:14:01 +01:00
|
|
|
.PHONY: build
|
2017-08-13 09:41:50 -07:00
|
|
|
build:
|
release: add more build targets (#1179)
* release: add more build targets
This adds amd64, ppc and s390. Rework some other builds/directories.
This builds:
% find build
build
build/darwin
build/darwin/x86_64
build/darwin/x86_64/coredns
build/linux
build/linux/ppc64
build/linux/ppc64/coredns
build/linux/x86_64
build/linux/x86_64/coredns
build/linux/arm64
build/linux/arm64/coredns
build/linux/s390
build/linux/s390/coredns
build/linux/arm
build/linux/arm/coredns
% make -f Makefile.release tar
rm -rf release && mkdir release
tar -zcf release/coredns_0.9.9_linux_x86_64.tgz -C build/linux/x86_64 coredns
tar -zcf release/coredns_0.9.9_darwin_x86_64.tgz -C build/darwin/x86_64 coredns
tar -zcf release/coredns_0.9.9_linux_armv6l.tgz -C build/linux/arm coredns
tar -zcf release/coredns_0.9.9_linux_armv8l.tgz -C build/linux/arm64 coredns
tar -zcf release/coredns_0.9.9_linux_ppc64le.tgz -C build/linux/ppc64 coredns
tar -zcf release/coredns_0.9.9_linux_s390x.tgz -C build/linux/s390 coredns
Checking:
% for i in $(find build -type f); do file $i; done
build/darwin/x86_64/coredns: Mach-O 64-bit x86_64 executable, flags:<NOUNDEFS>
build/linux/ppc64/coredns: ELF 64-bit LSB executable, 64-bit PowerPC or cisco 7500, version 1 (SYSV), statically linked, stripped
build/linux/x86_64/coredns: ELF 64-bit LSB executable, x86-64, version 1 (SYSV), statically linked, stripped
build/linux/arm64/coredns: ELF 64-bit LSB executable, ARM aarch64, version 1 (SYSV), statically linked, stripped
build/linux/s390/coredns: ELF 64-bit MSB executable, IBM S/390, version 1 (SYSV), statically linked, stripped
build/linux/arm/coredns: ELF 32-bit LSB executable, ARM, EABI5 version 1 (SYSV), statically linked, stripped
* code review
2017-10-28 03:54:42 +01:00
|
|
|
@echo Cleaning old builds
|
Makefile: add Windows target (#1199)
While we at it, why not add a target for Windows as well.
This also introduces a VERBOSE option that defaults to -v, but it empty
when releases so that you can actually see what you're building.
Move an @echo out of shell snippet into the Makefile, as that errored
with @echo: command not found.
Sample run and resulting artifacts:
~~~
% make -f Makefile.release build
% find build -type f -exec file {} \;
build/windows/amd64/coredns: PE32+ executable (console) x86-64 (stripped to external PDB), for MS Windows
build/darwin/amd64/coredns: Mach-O 64-bit x86_64 executable, flags:<NOUNDEFS>
build/linux/ppc64le/coredns: ELF 64-bit LSB executable, 64-bit PowerPC or cisco 7500, version 1 (SYSV), statically linked, stripped
build/linux/amd64/coredns: ELF 64-bit LSB executable, x86-64, version 1 (SYSV), statically linked, stripped
build/linux/arm/coredns: ELF 32-bit LSB executable, ARM, EABI5 version 1 (SYSV), statically linked, stripped
build/linux/s390x/coredns: ELF 64-bit MSB executable, IBM S/390, version 1 (SYSV), statically linked, stripped
build/linux/arm64/coredns: ELF 64-bit LSB executable, ARM aarch64, version 1 (SYSV), statically linked, stripped
% make -f Makefile.release tar
% find release -type f | sort
release/coredns_0.9.9_darwin_amd64.tgz
release/coredns_0.9.9_linux_amd64.tgz
release/coredns_0.9.9_linux_arm64.tgz
release/coredns_0.9.9_linux_arm.tgz
release/coredns_0.9.9_linux_ppc64le.tgz
release/coredns_0.9.9_linux_s390x.tgz
release/coredns_0.9.9_windows_amd64.tgz
~~~
2017-11-03 13:45:13 +00:00
|
|
|
@rm -rf build && mkdir build
|
2018-07-10 04:35:58 +01:00
|
|
|
@echo Building: darwin/amd64 - $(VERSION)
|
2018-02-28 12:13:46 -08:00
|
|
|
mkdir -p build/darwin/amd64 && $(MAKE) coredns BINARY=build/darwin/amd64/$(NAME) SYSTEM="GOOS=darwin GOARCH=amd64" CHECKS="godeps" VERBOSE=""
|
2018-07-10 04:35:58 +01:00
|
|
|
@echo Building: windows/amd64 - $(VERSION)
|
2018-08-03 09:49:13 -07:00
|
|
|
mkdir -p build/windows/amd64 && $(MAKE) coredns BINARY=build/windows/amd64/$(NAME).exe SYSTEM="GOOS=windows GOARCH=amd64" CHECKS="" VERBOSE=""
|
2018-07-10 04:35:58 +01:00
|
|
|
@echo Building: linux/$(LINUX_ARCH) - $(VERSION) ;\
|
2017-11-02 21:21:57 +00:00
|
|
|
for arch in $(LINUX_ARCH); do \
|
2018-07-10 04:35:58 +01:00
|
|
|
mkdir -p build/linux/$$arch && $(MAKE) coredns BINARY=build/linux/$$arch/$(NAME) SYSTEM="GOOS=linux GOARCH=$$arch" CHECKS="" VERBOSE="" ;\
|
2017-11-02 21:21:57 +00:00
|
|
|
done
|
2016-09-18 14:14:01 +01:00
|
|
|
|
2016-11-27 15:19:41 +00:00
|
|
|
.PHONY: tar
|
|
|
|
|
tar:
|
2017-10-30 15:55:41 +00:00
|
|
|
@echo Cleaning old releases
|
Makefile: add Windows target (#1199)
While we at it, why not add a target for Windows as well.
This also introduces a VERBOSE option that defaults to -v, but it empty
when releases so that you can actually see what you're building.
Move an @echo out of shell snippet into the Makefile, as that errored
with @echo: command not found.
Sample run and resulting artifacts:
~~~
% make -f Makefile.release build
% find build -type f -exec file {} \;
build/windows/amd64/coredns: PE32+ executable (console) x86-64 (stripped to external PDB), for MS Windows
build/darwin/amd64/coredns: Mach-O 64-bit x86_64 executable, flags:<NOUNDEFS>
build/linux/ppc64le/coredns: ELF 64-bit LSB executable, 64-bit PowerPC or cisco 7500, version 1 (SYSV), statically linked, stripped
build/linux/amd64/coredns: ELF 64-bit LSB executable, x86-64, version 1 (SYSV), statically linked, stripped
build/linux/arm/coredns: ELF 32-bit LSB executable, ARM, EABI5 version 1 (SYSV), statically linked, stripped
build/linux/s390x/coredns: ELF 64-bit MSB executable, IBM S/390, version 1 (SYSV), statically linked, stripped
build/linux/arm64/coredns: ELF 64-bit LSB executable, ARM aarch64, version 1 (SYSV), statically linked, stripped
% make -f Makefile.release tar
% find release -type f | sort
release/coredns_0.9.9_darwin_amd64.tgz
release/coredns_0.9.9_linux_amd64.tgz
release/coredns_0.9.9_linux_arm64.tgz
release/coredns_0.9.9_linux_arm.tgz
release/coredns_0.9.9_linux_ppc64le.tgz
release/coredns_0.9.9_linux_s390x.tgz
release/coredns_0.9.9_windows_amd64.tgz
~~~
2017-11-03 13:45:13 +00:00
|
|
|
@rm -rf release && mkdir release
|
2017-11-02 10:59:30 -07:00
|
|
|
tar -zcf release/$(NAME)_$(VERSION)_darwin_amd64.tgz -C build/darwin/amd64 $(NAME)
|
2018-08-03 09:49:13 -07:00
|
|
|
tar -zcf release/$(NAME)_$(VERSION)_windows_amd64.tgz -C build/windows/amd64 $(NAME).exe
|
2017-11-02 21:21:57 +00:00
|
|
|
for arch in $(LINUX_ARCH); do \
|
|
|
|
|
tar -zcf release/$(NAME)_$(VERSION)_linux_$$arch.tgz -C build/linux/$$arch $(NAME) ;\
|
|
|
|
|
done
|
2016-11-27 15:19:41 +00:00
|
|
|
|
2018-07-21 16:39:53 +01:00
|
|
|
.PHONY: sum
|
|
|
|
|
sum:
|
|
|
|
|
for asset in `ls -A release/*tgz`; do \
|
|
|
|
|
sha256sum $$asset > $$asset.sha256; \
|
|
|
|
|
done
|
|
|
|
|
|
2018-07-10 04:35:58 +01:00
|
|
|
.PHONY: github-push
|
2018-07-11 09:56:37 +01:00
|
|
|
github-push:
|
2016-11-27 15:19:41 +00:00
|
|
|
@echo Releasing: $(VERSION)
|
2018-07-10 12:28:29 +01:00
|
|
|
@$(eval RELEASE:=$(shell curl -s -d '{"tag_name": "v$(VERSION)", "name": "v$(VERSION)"}' "https://api.github.com/repos/$(GITHUB)/$(NAME)/releases?access_token=${GITHUB_ACCESS_TOKEN}" | grep -m 1 '"id"' | tr -cd '[[:digit:]]'))
|
2018-06-24 11:21:58 -07:00
|
|
|
@echo ReleaseID: $(RELEASE)
|
2018-08-28 21:58:35 +01:00
|
|
|
@for asset in `ls -A release/*tgz`; do \
|
2018-08-27 21:33:25 +01:00
|
|
|
echo $$asset; \
|
2018-06-24 11:21:58 -07:00
|
|
|
curl -o /dev/null -X POST \
|
|
|
|
|
-H "Content-Type: application/gzip" \
|
|
|
|
|
--data-binary "@release/$$asset" \
|
|
|
|
|
"https://uploads.github.com/repos/$(GITHUB)/$(NAME)/releases/$(RELEASE)/assets?name=$${asset}&access_token=${GITHUB_ACCESS_TOKEN}" ; \
|
|
|
|
|
done
|
2018-08-28 21:58:35 +01:00
|
|
|
@for asset in `ls -A release/*sha256`; do \
|
|
|
|
|
echo $$asset; \
|
|
|
|
|
curl -o /dev/null -X POST \
|
|
|
|
|
-H "Content-Type: text/plain" \
|
|
|
|
|
--data-binary "@release/$$asset" \
|
|
|
|
|
"https://uploads.github.com/repos/$(GITHUB)/$(NAME)/releases/$(RELEASE)/assets?name=$${asset}&access_token=${GITHUB_ACCESS_TOKEN}" ; \
|
|
|
|
|
done
|
2016-09-18 14:14:01 +01:00
|
|
|
|
2017-03-01 15:46:26 +00:00
|
|
|
.PHONY: docker-build
|
2017-11-02 21:21:57 +00:00
|
|
|
docker-build: tar
|
2018-07-11 09:56:37 +01:00
|
|
|
@# Steps:
|
|
|
|
|
@# 1. Copy appropriate coredns binary to build/docker/linux/<arch>
|
|
|
|
|
@# 2. Copy Dockerfile to build/docker/linux/<arch>
|
|
|
|
|
@rm -rf build/docker
|
2017-11-02 21:21:57 +00:00
|
|
|
for arch in $(LINUX_ARCH); do \
|
2017-11-03 13:29:50 -07:00
|
|
|
mkdir -p build/docker/linux/$$arch ;\
|
|
|
|
|
tar -xzf release/$(NAME)_$(VERSION)_linux_$$arch.tgz -C build/docker/linux/$$arch ;\
|
|
|
|
|
cp Dockerfile build/docker/linux/$$arch ;\
|
|
|
|
|
docker build -t coredns build/docker/linux/$$arch ;\
|
2017-11-02 21:21:57 +00:00
|
|
|
docker tag coredns $(DOCKER_IMAGE_NAME):coredns-$$arch ;\
|
|
|
|
|
done
|
2017-03-01 15:46:26 +00:00
|
|
|
|
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
2017-12-21 15:34:19 +00:00
|
|
|
.PHONY: docker-push
|
|
|
|
|
docker-push:
|
2018-07-11 09:56:37 +01:00
|
|
|
@echo $(DOCKER_PASSWORD) | docker login -u $(DOCKER_LOGIN) --password-stdin
|
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
2017-12-21 15:34:19 +00:00
|
|
|
@echo Pushing: $(VERSION) to $(DOCKER_IMAGE_NAME)
|
2017-11-02 21:21:57 +00:00
|
|
|
for arch in $(LINUX_ARCH); do \
|
2017-11-03 20:52:53 +00:00
|
|
|
docker push $(DOCKER_IMAGE_NAME):coredns-$$arch ;\
|
2017-11-02 21:21:57 +00:00
|
|
|
done
|
2017-11-04 00:41:35 -07:00
|
|
|
manifest-tool push from-args --platforms $(PLATFORMS) --template $(DOCKER_IMAGE_NAME):coredns-ARCH --target $(DOCKER_IMAGE_NAME):$(VERSION)
|
|
|
|
|
manifest-tool push from-args --platforms $(PLATFORMS) --template $(DOCKER_IMAGE_NAME):coredns-ARCH --target $(DOCKER_IMAGE_NAME):latest
|
2017-03-01 15:46:26 +00:00
|
|
|
|
2016-09-18 14:14:01 +01:00
|
|
|
.PHONY: clean
|
|
|
|
|
clean:
|
|
|
|
|
rm -rf release
|
|
|
|
|
rm -rf build
|