Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
C
Coredns
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Locked Files
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Security & Compliance
Security & Compliance
Dependency List
License Compliance
Packages
Packages
List
Container Registry
Analytics
Analytics
CI / CD
Code Review
Insights
Issues
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Railgun
Coredns
Commits
2299c5b6
Commit
2299c5b6
authored
Nov 11, 2020
by
Miek Gieben
Committed by
GitHub
Nov 11, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add make notes target (#4276)
Automatically submitted.
parent
9178f9d1
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
30 additions
and
19 deletions
+30
-19
Makefile.release
Makefile.release
+30
-19
No files found.
Makefile.release
View file @
2299c5b6
# Makefile for releasing CoreDNS
# Makefile for releasing CoreDNS
#
#
# The release is controlled from coremain/version.go. The version found there is
# 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
# used to tag the git repo and to build the assets that are uploaded to GitHub.
# (after some sanity checks).
#
#
# The release should be accompanied by release notes in the notes/ subdirectory.
# The release should be accompanied by release notes in the notes/ subdirectory.
# These are published on coredns.io. For example see: notes/coredns-1.5.1.md
# These are published on coredns.io. For example see: notes/coredns-1.5.1.md
# Use make -f Makefile.release notes to create a skeleton notes document.
#
#
# Getting the authors for this release is done with the following command line
# Be sure to prune the PR list a bit, not everything is worthy!
# See the 'authors' target.
#
# git log --pretty=format:'%an' $(git describe --tags --abbrev=0)..master | sort -u
#
# Getting all pull requests merged since the last tag can be done with this "oneliner"
# See the 'prs' target.
#
# % git log $(git describe --tags --abbrev=0)..HEAD --oneline | awk ' { $1="";print } ' | sed 's/^ //' | sed -e 's|#\([0-9]\)|https://github.com/coredns/coredns/pull/\1|'
#
#
# As seen in notes/coredns-1.5.1.md we want to style the notes in the following manner:
# As seen in notes/coredns-1.5.1.md we want to style the notes in the following manner:
#
#
...
@@ -65,10 +57,6 @@ DOCKER_IMAGE_NAME:=$(DOCKER)/$(NAME)
...
@@ -65,10 +57,6 @@ DOCKER_IMAGE_NAME:=$(DOCKER)/$(NAME)
LINUX_ARCH
:=
amd64 arm arm64 ppc64le s390x
LINUX_ARCH
:=
amd64 arm arm64 ppc64le s390x
PLATFORMS
:=
$(
subst
$(SPACE)
,
$(COMMA)
,
$(
foreach
arch
,
$(LINUX_ARCH)
,linux/
$(arch)
))
PLATFORMS
:=
$(
subst
$(SPACE)
,
$(COMMA)
,
$(
foreach
arch
,
$(LINUX_ARCH)
,linux/
$(arch)
))
ifeq
($(DOCKER),)
$(error
"Please specify Docker registry to use. Use DOCKER=coredns for releases"
)
endif
all
:
all
:
@
echo
Use the
'release'
target to build a release,
'docker'
for
docker build.
@
echo
Use the
'release'
target to build a release,
'docker'
for
docker build.
...
@@ -111,6 +99,9 @@ tar:
...
@@ -111,6 +99,9 @@ tar:
.PHONY
:
github-push
.PHONY
:
github-push
github-push
:
github-push
:
ifeq
($(GITHUB_ACCESS_TOKEN),)
$(
error
"Please set the GITHUB_ACCESS_TOKEN environment variable"
)
else
@
echo
Releasing:
$(VERSION)
@
echo
Releasing:
$(VERSION)
@
$(
eval
RELEASE:
=
$(
shell
curl
-s
-d
'{"tag_name": "v
$(VERSION)
", "name": "v
$(VERSION)
"
}
'
-H
"Authorization: token
${GITHUB_ACCESS_TOKEN}
"
"https://api.github.com/repos/
$(GITHUB)
/
$(NAME)
/releases"
|
grep
-m
1
'"id"'
|
tr
-cd
'[[:digit:]]'
)
)
@
$(
eval
RELEASE:
=
$(
shell
curl
-s
-d
'{"tag_name": "v
$(VERSION)
", "name": "v
$(VERSION)
"
}
'
-H
"Authorization: token
${GITHUB_ACCESS_TOKEN}
"
"https://api.github.com/repos/
$(GITHUB)
/
$(NAME)
/releases"
|
grep
-m
1
'"id"'
|
tr
-cd
'[[:digit:]]'
)
)
@
echo
ReleaseID:
$(RELEASE)
@
echo
ReleaseID:
$(RELEASE)
...
@@ -133,9 +124,13 @@ github-push:
...
@@ -133,9 +124,13 @@ github-push:
--data-binary
"@
$$
asset"
\
--data-binary
"@
$$
asset"
\
"https://uploads.github.com/repos/
$(GITHUB)
/
$(NAME)
/releases/
$(RELEASE)
/assets?name=
$
${asset}
"
;
\
"https://uploads.github.com/repos/
$(GITHUB)
/
$(NAME)
/releases/
$(RELEASE)
/assets?name=
$
${asset}
"
;
\
done
)
done
)
endif
.PHONY
:
docker-build
.PHONY
:
docker-build
docker-build
:
tar
docker-build
:
tar
ifeq
($(DOCKER),)
$(
error
"Please specify Docker registry to use. Use DOCKER=coredns for releases"
)
else
@
# Steps:
@
# Steps:
@
# 1. Copy appropriate coredns binary to build/docker/linux/<arch>
@
# 1. Copy appropriate coredns binary to build/docker/linux/<arch>
@
# 2. Copy Dockerfile to build/docker/linux/<arch>
@
# 2. Copy Dockerfile to build/docker/linux/<arch>
...
@@ -147,9 +142,13 @@ docker-build: tar
...
@@ -147,9 +142,13 @@ docker-build: tar
docker build
-t
coredns build/docker/linux/
$$
arch
;
\
docker build
-t
coredns build/docker/linux/
$$
arch
;
\
docker tag coredns
$(DOCKER_IMAGE_NAME)
:coredns-
$$
arch
;
\
docker tag coredns
$(DOCKER_IMAGE_NAME)
:coredns-
$$
arch
;
\
done
done
endif
.PHONY
:
docker-push
.PHONY
:
docker-push
docker-push
:
docker-push
:
ifeq
($(DOCKER),)
$(
error
"Please specify Docker registry to use. Use DOCKER=coredns for releases"
)
else
@
echo
$(DOCKER_PASSWORD)
| docker login
-u
$(DOCKER_LOGIN)
--password-stdin
@
echo
$(DOCKER_PASSWORD)
| docker login
-u
$(DOCKER_LOGIN)
--password-stdin
@
echo
Pushing:
$(VERSION)
to
$(DOCKER_IMAGE_NAME)
@
echo
Pushing:
$(VERSION)
to
$(DOCKER_IMAGE_NAME)
for
arch
in
$(LINUX_ARCH)
;
do
\
for
arch
in
$(LINUX_ARCH)
;
do
\
...
@@ -157,6 +156,7 @@ docker-push:
...
@@ -157,6 +156,7 @@ docker-push:
done
done
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)
:
$(VERSION)
manifest-tool push from-args
--platforms
$(PLATFORMS)
--template
$(DOCKER_IMAGE_NAME)
:coredns-ARCH
--target
$(DOCKER_IMAGE_NAME)
:latest
manifest-tool push from-args
--platforms
$(PLATFORMS)
--template
$(DOCKER_IMAGE_NAME)
:coredns-ARCH
--target
$(DOCKER_IMAGE_NAME)
:latest
endif
.PHONY
:
version
.PHONY
:
version
version
:
version
:
...
@@ -167,12 +167,23 @@ clean:
...
@@ -167,12 +167,23 @@ clean:
rm
-rf
release
rm
-rf
release
rm
-rf
build
rm
-rf
build
.PHONY
:
notes
notes
:
@
$(MAKE)
-s
-f
Makefile.release authors
@
echo
@
$(MAKE)
-s
-f
Makefile.release prs
.PHONY
:
prs
.PHONY
:
prs
prs
:
prs
:
git log
$$
(
git describe
--tags
--abbrev
=
0
)
..HEAD
--oneline
|
awk
' { $$1="";print } '
|
sed
's/^ //'
|
sed
-e
's|#\([0-9]\)|https://github.com/coredns/coredns/pull/\1|'
|
\
@
echo
"## Noteworthy Changes"
grep
-v
'^build(deps)'
|
\
@
echo
grep
-v
'^auto go mod tidy'
@
git log
$$
(
git describe
--tags
--abbrev
=
0
)
..HEAD
--oneline
|
awk
' { $$1="";print } '
|
sed
's/^ //'
|
sed
-e
's|#\([0-9]\)|https://github.com/coredns/coredns/pull/\1|'
|
\
grep
-v
'^build(deps)'
|
\
grep
-v
'^auto go mod tidy'
|
grep
-v
'^auto remove'
|
grep
-v
'^auto make'
|
sed
's/^/* /'
.PHONY
:
authors
.PHONY
:
authors
authors
:
authors
:
git log
--pretty
=
format:
'%an'
$$
(
git describe
--tags
--abbrev
=
0
)
..master |
sort
-u
@
echo
"## Brought to You By"
@
echo
@
git log
--pretty
=
format:
'%an'
$$
(
git describe
--tags
--abbrev
=
0
)
..master |
sort
-u
|
grep
-v
'^coredns-auto'
|
grep
-v
'^dependabot-preview'
|
\
tac
|
cat
-n
|
sed
-e
's/^[[:space:]]\+1[[:space:]]\+\(.*\)/\1./'
|
sed
-e
's/^[[:space:]]\+[[:digit:]]\+[[:space:]]\+\(.*\)/\1,/'
|
tac
# comma separate, with dot at the end
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment