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
|
|
|
#
|
2017-10-30 15:55:41 +00:00
|
|
|
# We use https://github.com/progrium/gh-release to automate github stuff be sure
|
|
|
|
|
# to have that binary in your path.
|
2016-09-18 14:14:01 +01:00
|
|
|
#
|
2016-11-11 09:36:26 +00:00
|
|
|
# Get a list of authors for this release with:
|
|
|
|
|
#
|
2017-10-30 15:55:41 +00:00
|
|
|
# git log --pretty=format:'%an' v001..master | sort -u (where v001 is the
|
|
|
|
|
# previous release, obviously you'll need to adjust this)
|
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:
|
2017-10-30 15:55:41 +00:00
|
|
|
#
|
2016-09-18 14:14:01 +01:00
|
|
|
# * Get an access token: https://help.github.com/articles/creating-an-access-token-for-command-line-use/
|
|
|
|
|
# * export GITHUB_ACCESS_TOKEN=<token>
|
|
|
|
|
# * Up the version in coremain/version.go
|
2018-01-26 16:57:08 +00:00
|
|
|
# * Run: make DOCKER=coredns -f Makefile.release release
|
|
|
|
|
# * runs make -f Makefile.doc
|
|
|
|
|
# * this is a noop if ronn can't be found
|
|
|
|
|
# * perform a go generate
|
|
|
|
|
# * will *commit* your change(s) with 'Release $VERSION'
|
2016-11-11 17:56:54 +00:00
|
|
|
# * push to github
|
|
|
|
|
# * build the release and do all that fluff.
|
2017-03-01 15:46:26 +00:00
|
|
|
#
|
2017-10-30 15:55:41 +00:00
|
|
|
# Steps for docker:
|
|
|
|
|
#
|
2017-03-01 15:46:26 +00:00
|
|
|
# * Login into docker: docker login (should have push creds for coredns registry)
|
2017-11-02 16:15:17 -04:00
|
|
|
# * 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.
|
|
|
|
|
#
|
2017-12-21 10:47:09 -05:00
|
|
|
# * Run: make DOCKER=coredns -f Makefile.release docker
|
2017-07-24 08:24:53 -07: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
|
|
|
# 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)
|
2016-09-18 14:14:01 +01:00
|
|
|
|
2017-09-15 09:56:20 +01:00
|
|
|
ifeq (, $(shell which gh-release))
|
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
|
|
|
$(error "No gh-release in $$PATH, install with: go get github.com/progrium/gh-release")
|
2017-09-15 09:56:20 +01:00
|
|
|
endif
|
|
|
|
|
|
2017-11-02 16:15:17 -04:00
|
|
|
ifeq (, $(shell which manifest-tool))
|
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
|
|
|
$(error "No manifest-tool in $$PATH, install with: go get github.com/estesp/manifest-tool")
|
2017-11-02 16:15:17 -04: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-08-11 09:47:37 -07:00
|
|
|
GITCOMMIT:=$(shell git describe --dirty --always)
|
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:
|
|
|
|
|
@echo Use the 'release' target to start a release
|
2016-10-19 20:49:27 +01:00
|
|
|
|
2018-01-26 16:57:08 +00:00
|
|
|
release: pre commit push build tar upload
|
2017-05-12 10:15:34 +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
|
|
|
docker: docker-build docker-push
|
2017-03-01 15:46:26 +00:00
|
|
|
|
2018-01-26 16:57:08 +00:00
|
|
|
.PHONY: pre
|
|
|
|
|
pre:
|
|
|
|
|
go generate
|
|
|
|
|
$(MAKE) -f Makefile.doc
|
|
|
|
|
|
2016-10-19 20:49:27 +01:00
|
|
|
.PHONY: push
|
|
|
|
|
push:
|
|
|
|
|
@echo Pushing release to master
|
|
|
|
|
git push
|
2016-09-18 14:14:01 +01:00
|
|
|
|
2016-11-11 17:56:54 +00:00
|
|
|
.PHONY: commit
|
|
|
|
|
commit:
|
|
|
|
|
@echo Committing
|
|
|
|
|
git commit -am"Release $(VERSION)"
|
|
|
|
|
|
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
|
2017-04-30 11:48:19 +01:00
|
|
|
@echo Building: darwin $(VERSION)
|
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
|
|
|
mkdir -p build/darwin/amd64 && $(MAKE) coredns BINARY=build/darwin/amd64/$(NAME) SYSTEM="GOOS=darwin GOARCH=amd64" CHECKS="" VERBOSE=""
|
|
|
|
|
@echo Building: windows $(VERSION)
|
|
|
|
|
mkdir -p build/windows/amd64 && $(MAKE) coredns BINARY=build/windows/amd64/$(NAME) SYSTEM="GOOS=windows GOARCH=amd64" CHECKS="" VERBOSE=""
|
|
|
|
|
@echo Building: linux/$(LINUX_ARCH) $(VERSION) ;\
|
2017-11-02 21:21:57 +00:00
|
|
|
for arch in $(LINUX_ARCH); do \
|
2017-11-16 21:25:08 +00: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)
|
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
|
|
|
tar -zcf release/$(NAME)_$(VERSION)_windows_amd64.tgz -C build/windows/amd64 $(NAME)
|
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
|
|
|
|
2017-05-12 10:15:34 +01:00
|
|
|
.PHONY: upload
|
|
|
|
|
upload:
|
2016-11-27 15:19:41 +00:00
|
|
|
@echo Releasing: $(VERSION)
|
2016-09-18 14:25:47 +01:00
|
|
|
gh-release create $(GITHUB)/$(NAME) $(VERSION)
|
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
|
2017-11-03 13:29:50 -07:00
|
|
|
# Steps:
|
|
|
|
|
# 1. Copy appropriate coredns binary to build/docker/linux/<arch>
|
|
|
|
|
# 2. Copy Dockerfile to build/docker/linux/<arch>
|
|
|
|
|
# 3. Replace base image from alpine:latest to <arch>/alpine:latest
|
|
|
|
|
# 4. Comment RUN in Dockerfile
|
|
|
|
|
# <arch>:
|
|
|
|
|
# arm: arm32v6
|
|
|
|
|
# arm64: arm64v8
|
|
|
|
|
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 ;\
|
|
|
|
|
if [ $$arch != amd64 ]; then \
|
|
|
|
|
case $$arch in \
|
|
|
|
|
arm) \
|
|
|
|
|
BASEIMAGE=arm32v6 ;\
|
|
|
|
|
;; \
|
|
|
|
|
arm64) \
|
|
|
|
|
BASEIMAGE=arm64v8 ;\
|
|
|
|
|
;; \
|
|
|
|
|
*) \
|
|
|
|
|
BASEIMAGE=$$arch ;\
|
|
|
|
|
;; \
|
|
|
|
|
esac ;\
|
|
|
|
|
sed -e "s/alpine:latest/$$BASEIMAGE\\/alpine:latest/" -i build/docker/linux/$$arch/Dockerfile ;\
|
|
|
|
|
sed -e "s/^\\s*RUN/#RUN/" -i build/docker/linux/$$arch/Dockerfile ;\
|
|
|
|
|
fi ;\
|
|
|
|
|
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:
|
|
|
|
|
@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
|