diff options
author | Paweł Krupa <pawel@krupa.net.pl> | 2018-11-01 11:17:04 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-11-01 11:17:04 +0100 |
commit | 5bcaae918eaa3ded10000429906bba56da2b8d11 (patch) | |
tree | 9159776ef848ca7d508468aad38fd01e400284f8 /.travis | |
parent | 208821f74fa15849bcc7bad1344cf016a845199e (diff) |
simplify CI system configuration (#4534)
[minor]
Diffstat (limited to '.travis')
-rw-r--r-- | .travis/README.md | 35 | ||||
-rwxr-xr-x | .travis/create_artifacts.sh | 31 | ||||
-rwxr-xr-x | .travis/firehol_create_artifacts.sh | 31 | ||||
-rwxr-xr-x | .travis/releaser.sh | 11 |
4 files changed, 80 insertions, 28 deletions
diff --git a/.travis/README.md b/.travis/README.md index c737b5aba0..df68c1d4b2 100644 --- a/.travis/README.md +++ b/.travis/README.md @@ -27,6 +27,7 @@ installations of netdata. Jobs are run on following operating systems: - ubuntu 16.04 (containerized) - CentOS 6 (containerized) - CentOS 7 (containerized) + - alpine (containerized) ### Release @@ -41,15 +42,33 @@ Releases are generated by searching for a keyword in last commit message. Keywor All keywords MUST be surrounded with square braces. Alternative is to push a tag to master branch. -### Packages +### Packaging -As a name might suggest, this stage is responsible for creating netdata packages such as: +This stage is executed only on "master" branch and it is separated into 3 jobs: + - Update Changelog/Create release + - Nightly tarball and self-extractor build + - Nightly docker images + +##### Update Changelog/Create release + +This job is running one script called `releaser.sh`, which is responsible for a couple of things. First of all it +automatically updates our CHANGELOG.md file based on GitHub features (mostly labels and pull requests). Apart from +that it can also create a new git tag and a github draft release connected to that tag. +Releases 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 brackets. + +Alternatively new release can be also created by pushing new tag to master branch. + +##### Nightly tarball and self-extractor build AND Nightly docker images + +As names might suggest those two jobs are responsible for nightly netdata package creation and are run every day (in +cron). Combined they produce: - docker images - - tar repository (soon to be removed) + - tar.gz archive (soon to be removed) - self-extracting package -This stage is separated into 2 parallel jobs. One creating docker images and second one creating github artifacts. -Whole stage is executed only on master branch, but there are also additional parameters assigned to jobs: - - docker images - execution only on cron job or when there is a tag assigned starting with `v` - - artifacts - script responsible for creating artifacts doesn't have special conditions, but deployment to GitHub - releases is done only when there is tag assigned +Currently "Nightly tarball and self-extractor build" is using old firehol script and it is planed to be replaced with +new design. diff --git a/.travis/create_artifacts.sh b/.travis/create_artifacts.sh index 1251df1f37..6e545fdddf 100755 --- a/.travis/create_artifacts.sh +++ b/.travis/create_artifacts.sh @@ -7,20 +7,25 @@ then exit 1 fi -eval "$(ssh-agent -s)" -./.travis/decrypt-if-have-key decb6f6387c4 -export KEYSERVER=ipv4.pool.sks-keyservers.net -./packaging/gpg-recv-key phil@firehol.org "0762 9FF7 89EA 6156 012F 9F50 C406 9602 1359 9237" -./packaging/gpg-recv-key costa@tsaousis.gr "4DFF 624A E564 3B51 2872 1F40 29CA 3358 89B9 A863" -# Run the commit hooks in case the developer didn't -git diff 4b825dc642cb6eb9a060e54bf8d69288fbee4904 | ./packaging/check-files - -fakeroot ./packaging/git-build # Make sure stdout is in blocking mode. If we don't, then conda create will barf during downloads. # See https://github.com/travis-ci/travis-ci/issues/4704#issuecomment-348435959 for details. python -c 'import os,sys,fcntl; flags = fcntl.fcntl(sys.stdout, fcntl.F_GETFL); fcntl.fcntl(sys.stdout, fcntl.F_SETFL, flags&~os.O_NONBLOCK);' -# make self-extractor +echo "--- Create tarball ---" +make dist +echo "--- Create self-extractor ---" ./makeself/build-x86_64-static.sh -for i in *.tar.gz; do sha512sum -b "$i" > "$i.sha"; done -for i in *.gz.run; do sha512sum -b "$i" > "$i.sha"; done -sha256sum -b ./*.tar.gz ./*.gz.run > "sha256sums.txt" -./.travis/deploy-if-have-key + +echo "--- Create checksums ---" +GIT_TAG=$(git tag --points-at) +if [ "${GIT_TAG}" != "" ]; then + ln -s netdata-latest.gz.run "netdata-${GIT_TAG}.gz.run" + ln -s netdata-*.tar.gz "netdata-${GIT_TAG}.tar.gz" + sha256sum -b "netdata-${GIT_TAG}.gz.run" "netdata-${GIT_TAG}.tar.gz" > "sha256sums.txt" +else + sha256sum -b ./*.tar.gz ./*.gz.run > "sha256sums.txt" +fi + +echo "checksums:" +cat sha256sums.txt + + diff --git a/.travis/firehol_create_artifacts.sh b/.travis/firehol_create_artifacts.sh new file mode 100755 index 0000000000..3fcb910e7b --- /dev/null +++ b/.travis/firehol_create_artifacts.sh @@ -0,0 +1,31 @@ +#!/bin/bash +# shellcheck disable=SC2230 + +# WARNING: This script is deprecated and placed here until @paulfantom figures out how to fully replace it + +if [ ! -f .gitignore ] +then + echo "Run as ./travis/$(basename "$0") from top level directory of git repository" + exit 1 +fi + +eval "$(ssh-agent -s)" +./.travis/decrypt-if-have-key decb6f6387c4 +export KEYSERVER=ipv4.pool.sks-keyservers.net +./packaging/gpg-recv-key phil@firehol.org "0762 9FF7 89EA 6156 012F 9F50 C406 9602 1359 9237" +./packaging/gpg-recv-key costa@tsaousis.gr "4DFF 624A E564 3B51 2872 1F40 29CA 3358 89B9 A863" +# Run the commit hooks in case the developer didn't +git diff 4b825dc642cb6eb9a060e54bf8d69288fbee4904 | ./packaging/check-files - +fakeroot ./packaging/git-build +# Make sure stdout is in blocking mode. If we don't, then conda create will barf during downloads. +# See https://github.com/travis-ci/travis-ci/issues/4704#issuecomment-348435959 for details. +python -c 'import os,sys,fcntl; flags = fcntl.fcntl(sys.stdout, fcntl.F_GETFL); fcntl.fcntl(sys.stdout, fcntl.F_SETFL, flags&~os.O_NONBLOCK);' +echo "--- Create tarball ---" +make dist +echo "--- Create self-extractor ---" +./makeself/build-x86_64-static.sh +echo "--- Create checksums ---" +for i in *.tar.gz; do sha512sum -b "$i" > "$i.sha"; done #FIXME remove? +for i in *.gz.run; do sha512sum -b "$i" > "$i.sha"; done #FIXME remove? +sha256sum -b ./*.tar.gz ./*.gz.run > "sha256sums.txt" +./.travis/deploy-if-have-key diff --git a/.travis/releaser.sh b/.travis/releaser.sh index 4da8f2472d..f1f647e485 100755 --- a/.travis/releaser.sh +++ b/.travis/releaser.sh @@ -94,14 +94,11 @@ if [ "${GIT_TAG}" == "HEAD" ]; then exit 0 fi -echo "---- CREATING RELEASE ARTIFACTS -----" -python -c 'import os,sys,fcntl; flags = fcntl.fcntl(sys.stdout, fcntl.F_GETFL); fcntl.fcntl(sys.stdout, fcntl.F_SETFL, flags&~os.O_NONBLOCK);' +echo "---- CREATING TAGGED DOCKER CONTAINERS ----" +./docker/build.sh -./makeself/build-x86_64-static.sh -make dist -ln -s netdata-latest.gz.run "netdata-${GIT_TAG}.gz.run" -ln -s netdata-*.tar.gz "netdata-${GIT_TAG}.tar.gz" -sha256sum -b "netdata-${GIT_TAG}.gz.run" "netdata-${GIT_TAG}.tar.gz" > "sha256sums.txt" +echo "---- CREATING RELEASE ARTIFACTS -----" +./.travis/create_artifacts.sh echo "---- CREATING RELEASE DRAFT WITH ASSETS -----" # Download hub |