diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index e1df33575..d935b518d 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -4,7 +4,7 @@ Authors are expected to include a changelog file with their pull requests. The changelog file should be a new file created in the `changelogs/unreleased` folder. The file should follow the -naming convention of `issue-username` and the contents of the file should be your text for the +naming convention of `pr-username` and the contents of the file should be your text for the changelog. ark/changelogs/unreleased <- folder diff --git a/Makefile b/Makefile index 1b0c60dcd..3244f9a69 100644 --- a/Makefile +++ b/Makefile @@ -233,6 +233,7 @@ clean: docker rmi $(BUILDER_IMAGE) ci: all verify test - +changelog: + hack/changelog.sh goreleaser: hack/goreleaser.sh diff --git a/changelogs/unreleased/.keep b/changelogs/unreleased/.keep new file mode 100644 index 000000000..e69de29bb diff --git a/changelogs/unreleased/000-username b/changelogs/unreleased/000-username deleted file mode 100644 index 8761b1366..000000000 --- a/changelogs/unreleased/000-username +++ /dev/null @@ -1 +0,0 @@ -Example changelog entry. diff --git a/hack/changelog.sh b/hack/changelog.sh new file mode 100755 index 000000000..d216a4840 --- /dev/null +++ b/hack/changelog.sh @@ -0,0 +1,31 @@ +#!/bin/bash + +# Copyright 2018 the Heptio Ark contributors. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +set -o errexit +set -o nounset +set -o pipefail + +CHANGELOG_PATH='changelogs/unreleased' +UNRELEASED=$(ls -t ${CHANGELOG_PATH}) +echo -e "Generating CHANGELOG markdown from ${CHANGELOG_PATH}\n" +for entry in $UNRELEASED +do + IFS=$'-' read -ra pruser <<<"$entry" + contents=$(cat ${CHANGELOG_PATH}/${entry}) + echo " * ${contents} (#${pruser[0]}, @${pruser[1]})" +done +echo -e "\nCopy and paste the list above in to the appropriate CHANGELOG file." +echo "Be sure to run: git rm ${CHANGELOG_PATH}/*"