mirror of
https://github.com/netdata/netdata.git
synced 2025-04-26 22:04:46 +00:00
add Travis ctrl file for checking if changes happened (#11383)
* #10298 add Travis ctrl file for checking if changes happened since last nightly * missing comment subject * #10298 repair shellcheck warning - useless cat
This commit is contained in:
parent
ee526cff25
commit
5123aee6c9
3 changed files with 21 additions and 2 deletions
|
@ -26,6 +26,21 @@ if [ ! "${TRAVIS_REPO_SLUG}" == "netdata/netdata" ]; then
|
|||
exit 0
|
||||
fi
|
||||
|
||||
# if nightlies.sh has not written this TRAVIS_BUILD_NUMBER, there's no
|
||||
# changes from last nigthly
|
||||
if [ -f .travis/current_build_status ]; then
|
||||
FILE_TRAVIS_BUILD_NUMBER=$(cut -d'#' -f2 < .travis/current_build_status)
|
||||
FILE_TRAVIS_BUILD_STATUS=$(cut -d- -f1 < .travis/current_build_status)
|
||||
if [[ ${FILE_TRAVIS_BUILD_NUMBER} -eq ${TRAVIS_BUILD_NUMBER} ]] && [[ ${FILE_TRAVIS_BUILD_STATUS} == "changes" ]]; then
|
||||
echo "Changes happen since last nightly release, let's continue"
|
||||
else
|
||||
echo "No changes since last nightly release, nothing else to do"
|
||||
exit 0
|
||||
fi
|
||||
else
|
||||
echo "File .travis/current_build_status doesn't exist, probably this is the very first build, let's continue"
|
||||
fi
|
||||
|
||||
echo "--- Initialize git configuration ---"
|
||||
git checkout "${1-master}"
|
||||
git pull
|
||||
|
|
|
@ -37,8 +37,9 @@ echo "Changelog created! Adding packaging/version(${NEW_VERSION}) and CHANGELOG.
|
|||
echo "${NEW_VERSION}" > packaging/version
|
||||
git add packaging/version && echo "1) Added packaging/version to repository" || FAIL=1
|
||||
git add CHANGELOG.md && echo "2) Added changelog file to repository" || FAIL=1
|
||||
git commit -m '[ci skip] create nightly packages and update changelog' --author "${GIT_USER} <${GIT_MAIL}>" && echo "3) Committed changes to repository" || FAIL=1
|
||||
git push "https://${GITHUB_TOKEN}:@${PUSH_URL}" && echo "4) Pushed changes to remote ${PUSH_URL}" || FAIL=1
|
||||
git add .travis/current_build_status && echo "3) Added travis current build status file to repository" || FAIL=1
|
||||
git commit -m '[ci skip] create nightly packages and update changelog' --author "${GIT_USER} <${GIT_MAIL}>" && echo "4) Committed changes to repository" || FAIL=1
|
||||
git push "https://${GITHUB_TOKEN}:@${PUSH_URL}" && echo "5) Pushed changes to remote ${PUSH_URL}" || FAIL=1
|
||||
|
||||
# In case of a failure, wrap it up and bail out cleanly
|
||||
if [ $FAIL -eq 1 ]; then
|
||||
|
|
|
@ -31,6 +31,9 @@ PREVIOUS_NIGHTLY_COUNT="$(rev <packaging/version | cut -d- -f 2 | rev)"
|
|||
if [ "${COMMITS_SINCE_RELEASE}" == "${PREVIOUS_NIGHTLY_COUNT}" ]; then
|
||||
echo "No changes since last nightly release, nothing else to do"
|
||||
exit 0
|
||||
else
|
||||
echo "Changes happen since last nightly release"
|
||||
echo "changes-#${TRAVIS_BUILD_NUMBER}" > .travis/current_build_status
|
||||
fi
|
||||
|
||||
if [ ! "${TRAVIS_REPO_SLUG}" == "netdata/netdata" ]; then
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue