Browse Source

Move changelog generation to the end in release pipeline (#4712)

* move changelog generation to the end of release pipeline and create
[netdata patch release]

* fix configure.ac autocommit when tag is a rc tag

* do not create a release when commit is not tagged
Paweł Krupa 6 years ago
parent
commit
19e4b1c85e
3 changed files with 10 additions and 5 deletions
  1. 8 3
      .travis/releaser.sh
  2. 1 1
      .travis/tagger.sh
  3. 1 1
      configure.ac

+ 8 - 3
.travis/releaser.sh

@@ -40,9 +40,6 @@ echo "---- FIGURING OUT TAGS ----"
 #shellcheck source=/dev/null
 source .travis/tagger.sh || exit 0
 
-echo "---- GENERATING CHANGELOG -----"
-./.travis/generate_changelog.sh
-
 echo "---- CREATING TAGGED DOCKER CONTAINERS ----"
 export REPOSITORY="netdata/netdata"
 ./docker/build.sh
@@ -62,8 +59,16 @@ if [ -z ${GIT_TAG+x} ]; then
 	echo "Variable GIT_TAG is not set. Something went terribly wrong! Exiting."
 	exit 1
 fi
+if [ "${GIT_TAG}" != "$(git tag --points-at)" ]; then
+	echo "ERROR! Current commit is not tagged. Stopping release creation."
+	exit 1
+fi
 if [ -z ${RC+x} ]; then
 	hub release create --prerelease --draft -a "netdata-${GIT_TAG}.tar.gz" -a "netdata-${GIT_TAG}.gz.run" -a "sha256sums.txt" -m "${GIT_TAG}" "${GIT_TAG}"
 else
 	hub release create --draft -a "netdata-${GIT_TAG}.tar.gz" -a "netdata-${GIT_TAG}.gz.run" -a "sha256sums.txt" -m "${GIT_TAG}" "${GIT_TAG}"
 fi
+
+# Changelog needs to be created AFTER new release to avoid problems with circular dependencies and wrong entries in changelog file
+echo "---- GENERATING CHANGELOG -----"
+./.travis/generate_changelog.sh

+ 1 - 1
.travis/tagger.sh

@@ -28,7 +28,7 @@ function embed_version {
 	VERSION="$1"
 	MAJOR=$(echo "$GIT_TAG" | cut -d . -f 1 | cut -d v -f 2)
 	MINOR=$(echo "$GIT_TAG" | cut -d . -f 2)
-	PATCH=$(echo "$GIT_TAG" | cut -d . -f 3)
+	PATCH=$(echo "$GIT_TAG" | cut -d . -f 3 | cut -d '-' -f 1)
 	sed -i "s/\\[VERSION_MAJOR\\], \\[.*\\]/\\[VERSION_MAJOR\\], \\[$MAJOR\\]/" configure.ac
 	sed -i "s/\\[VERSION_MINOR\\], \\[.*\\]/\\[VERSION_MINOR\\], \\[$MINOR\\]/" configure.ac
 	sed -i "s/\\[VERSION_PATCH\\], \\[.*\\]/\\[VERSION_PATCH\\], \\[$PATCH\\]/" configure.ac

+ 1 - 1
configure.ac

@@ -6,7 +6,7 @@ AC_PREREQ(2.60)
 
 define([VERSION_MAJOR], [1])
 define([VERSION_MINOR], [11])
-define([VERSION_FIX], [1])
+define([VERSION_FIX], [0])
 define([VERSION_NUMBER], VERSION_MAJOR[.]VERSION_MINOR[.]VERSION_FIX)
 define([VERSION_SUFFIX], [_rolling])