diff options
author | Paweł Krupa <pawel@krupa.net.pl> | 2019-01-04 13:13:19 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-01-04 13:13:19 +0100 |
commit | 792a0e805454c79732c42caa72bc74aa489129e4 (patch) | |
tree | 2c7cdcbca8403b283fcfafe21d1aba453005d904 /.travis/nightlies.sh | |
parent | 8e42b85b44cf1753f09efdf4de5674c7860ee49d (diff) |
Unify versioning (#5051)
* use 'git describe'
* no need to embed version string anymore
* fallback mechanism for package versioning
Diffstat (limited to '.travis/nightlies.sh')
-rwxr-xr-x | .travis/nightlies.sh | 35 |
1 files changed, 35 insertions, 0 deletions
diff --git a/.travis/nightlies.sh b/.travis/nightlies.sh new file mode 100755 index 0000000000..ac00d1e1a7 --- /dev/null +++ b/.travis/nightlies.sh @@ -0,0 +1,35 @@ +#!/bin/bash + +set -e + +if [ ! -f .gitignore ]; then + echo "Run as ./travis/$(basename "$0") from top level directory of git repository" + exit 1 +fi + +export GIT_MAIL="pawel+bot@netdata.cloud" +export GIT_USER="netdatabot" +echo "--- Initialize git configuration ---" +git config user.email "${GIT_MAIL}" +git config user.name "${GIT_USER}" + +echo "--- UPDATE VERSION FILE ---" +LAST_TAG=$(git describe --abbrev=0 --tags) +NO_COMMITS=$(git rev-list "$LAST_TAG"..HEAD --count) +echo "$LAST_TAG-$((NO_COMMITS + 1))-nightly" >packaging/version +git add packaging/version + +echo "---- GENERATE CHANGELOG -----" +.travis/generate_changelog.sh +git add CHANGELOG.md + +echo "---- UPLOAD FILE CHANGES ----" +git commit -m '[ci skip] create nightly packages and update changelog' +git push "https://${GITHUB_TOKEN}:@$(git config --get remote.origin.url | sed -e 's/^https:\/\///')" + +echo "---- BUILD & PUBLISH DOCKER IMAGES ----" +export REPOSITORY="netdata/netdata" +packaging/docker/build.sh + +echo "---- BUILD ARTIFACTS ----" +.travis/create_artifacts.sh |