mirror of
https://github.com/netdata/netdata.git
synced 2021-06-06 23:03:21 +03:00
* netdata/packaging: bring el/6 first, because this appears on all cases. Otherwise travis craps out the steps * netdata/ci: Attempt to sanitise workflow for master branch commits 1) Rename Packaging for release, now named: Support activities on main branch 2) Adjust instruction messages to reflect more realistically the activities 3) Put labeler first on the stage, since this will always run 4) Make changelog and tag for release conditionally run, so that it does not confuse people * netdata/ci: Sanitise workflow for release more (explained below) We need to clean up tagging logic more and in order to do this we need to bring tagger logic to travis.yml Then we have the complete control of tagging and triggering for changelog generation in travis. To mitigate this, we need to: 1) make tagger script a lirbary. Keep the tagging logic in a method and remove the things needed when it was an executable (checks, executions etc) 2) make travis handle GIT_TAG checking and setting at the beginning. We need this outside of any conditionals so that we have GIT_TAG result available inside the steps 3) COMMIT_TAG_POINTS_AT can now become GIT_TAG, since this is what we actually wanted. We just named differently before to avoid any weird conflicts 4) make changelog generation for release to NOT source tagger any more. Also make it fail in case GIT_TAG is not there, we wont run the script if git tag not in place so that should be error if it happens 5) Rename .travis/generate_changelog_for_release.sh -> .travis/create_changelog_for_release.sh 6) Rename .travis/generate_changelog_and_tag_release.sh -> .travis/generate_changelog_for_release.sh * netdata/ci: reinstate filename here. we basically do the git tag operation here still * netdata/ci: simplify more the changelog generation process 1) Rename create_changelog_for_release.sh -> create_changelog.sh 2) Add comments and the standard path checks in create_changelog.sh 3) Do some minor changes to help diff with nightlies changelog (no functional change though, primarily messages and move flags lower) 4) Inside generate_changelog_for_nightlies.sh, use create_changelog.sh and remove code related to create changelog process 5) in nightlies.sh, use standard shebang adn fix some messages Note: might follow up with more changes, this is just a first batch * netdata/packaging: reinstate accidentally removed OPTS from other iterationns (different engineer)
62 lines
2.2 KiB
Bash
Executable File
62 lines
2.2 KiB
Bash
Executable File
# #BASH library
|
|
#
|
|
# Tags are generated by searching for a keyword in last commit message. Keywords are:
|
|
# - [patch] or [fix] to bump patch number
|
|
# - [minor], [feature] or [feat] to bump minor number
|
|
# - [major] or [breaking change] to bump major number
|
|
# All keywords MUST be surrounded with square braces.
|
|
#
|
|
# Requirements:
|
|
# - GITHUB_TOKEN variable set with GitHub token. Access level: repo.public_repo
|
|
# - git-semver python package (pip install git-semver)
|
|
#
|
|
# Original script is available at https://github.com/paulfantom/travis-helper/blob/master/releasing/releaser.sh
|
|
#
|
|
# Copyright: SPDX-License-Identifier: GPL-3.0-or-later
|
|
#
|
|
# Author : Pawel Krupa (paulfantom)
|
|
# Author : Pavlos Emm. Katsoulakis (paul@netdata.cloud)
|
|
|
|
# Figure out what will be new release candidate tag based only on previous ones.
|
|
# This assumes that RELEASES are in format of "v0.1.2" and prereleases (RCs) are using "v0.1.2-rc0"
|
|
function set_tag_release_candidate() {
|
|
LAST_TAG=$(git semver)
|
|
echo "${0}: Last tag found is: ${LAST_TAG}"
|
|
|
|
if [[ $LAST_TAG =~ -rc* ]]; then
|
|
VERSION=$(echo "$LAST_TAG" | cut -d'-' -f 1)
|
|
LAST_RC=$(echo "$LAST_TAG" | cut -d'c' -f 2)
|
|
RC=$((LAST_RC + 1))
|
|
else
|
|
VERSION="$(git semver --next-minor)"
|
|
RC=0
|
|
echo "${0}: Warning: Will set version to ${VERSION} (Last tag: ${LAST_TAG}) while tagged for release candidate generation"
|
|
fi
|
|
|
|
GIT_TAG="v${VERSION}-rc${RC}"
|
|
echo "${0}: Generated a new tag, set to: (${GIT_TAG})"
|
|
}
|
|
|
|
function set_tag_for_release() {
|
|
echo "${0}: Checking for tag existence"
|
|
if [ -z "${GIT_TAG}" ]; then
|
|
echo "${0}: No tag was found, generating a new tag"
|
|
git semver
|
|
|
|
echo "${0}: Last commit message: ${TRAVIS_COMMIT_MESSAGE}"
|
|
|
|
# Figure out next tag based on commit message
|
|
case "${TRAVIS_COMMIT_MESSAGE}" in
|
|
*"[netdata patch release]"*) GIT_TAG="v$(git semver --next-patch)" ;;
|
|
*"[netdata minor release]"*) GIT_TAG="v$(git semver --next-minor)" ;;
|
|
*"[netdata major release]"*) GIT_TAG="v$(git semver --next-major)" ;;
|
|
*"[netdata release candidate]"*) set_tag_release_candidate ;;
|
|
*)
|
|
echo "${0}: Keyword not detected. Nothing to set for GIT_TAG"
|
|
;;
|
|
esac
|
|
else
|
|
echo "${0}: We seem to already have a GIT_TAG set to (${GIT_TAG})"
|
|
fi
|
|
}
|