@cryptotaxi247 / netdata-1 / commits / 70de8647b

fix CI scripts configuration and [netdata minor release] and [minor] (just to be sure)

paulfantom committed Nov 1, 2018 at 19:25 UTC 70de8647b92cfa8761cdb97e22f8d952cdd78303
5 files changed +32 -27
.travis.yml
+5 -4
@@ -42,15 +42,18 @@ jobs:
42
43 - stage: packaging
44 name: Create release
45 - install: sudo apt-get install -y gnupg libcap2-bin zlib1g-dev uuid-dev fakeroot python-pip
45 + install: sudo apt update -y && sudo apt-get install -y gnupg libcap2-bin zlib1g-dev uuid-dev fakeroot python-pip && sudo apt install -y --only-upgrade docker-ce && docker info
46 before_script: sudo pip install git-semver
47 script: ".travis/releaser.sh"
48 + git:
49 + depth: false
50 + if: type != cron
51 - name: Nightly tarball and self-extractor build
52 install: sudo apt-get install -y gnupg libcap2-bin zlib1g-dev uuid-dev fakeroot
53 script: ".travis/firehol_create_artifacts.sh"
54 if: type = cron
55 - name: Nightly docker images
53 - install: sudo apt update -y && sudo apt install -y --only-upgrade docker-ce && docker info
56 + install: sudo apt update -y && sudo apt install -y --only-upgrade docker-ce && docker info
57 script: "docker/build.sh"
58 env: REPOSITORY="netdata/netdata"
59 if: type = cron
@@ -63,5 +66,3 @@ notifications:
66 webhooks: https://app.fossa.io/hooks/travisci
67 slack:
68 secure: Ntl1GNjgGDdmMQsudDi/4+co6zRV8znJXOB0joLVHNV1icHvUSMKShgpY08AoWoxNYMDVHXOUzEGwiZd6MI4MleNu9gwtACwgXe+sDjgBIDvQYC6JQS7XlANJfzBlZnrGnaiVVlBmI/LajgABCsrTAYV8gVrq2zA3u56UrNwS3qRJnbaqGgH64SnHbdllHQ7l7Qcc/27voy6Op32oJhDZ5bVY5CRZUR42oPvlDx9PSD0yqSkLwFrIE0Qg+mTVDZ4Watrv8iv91ghc6GwwPvNGShcYI04P8hn08FZ4eGH47K4AZf97IDargmxPsEwkOhgcl3w4J5KHZzmVb7hsEs6+iZz4KulD2u4D/xy5BGUcRZKMuyiO99dmZO61wP0Ra0Wzfe0exG+LFxAmC0jiYS67xL0YWs2SKkO7iftthI8NX1Lus1PGleBpJ28LKQdZjaKz3w2xIRlJ45eEdwBgtnNkW68NsmJCflrNkAlaVW6+zCPMpT4rT41rpkh0Fl+YbvOhH/S3VfiTY7OqTU5B9ttgJuN/m8PWi8g5MKO2C1TWkK3cV4O2PnpugtioHuTuj2X/AKOrh7hlefedDxPZPIxFmLi3OKtgHBzwzQk79p6V9ffbbVfsO+p8kiKJuc8s0v6d++Rt2FLXwUquJGDKC0hz8cAMSUiFaP5t1TlhTk7LJ4=
66 - on_success: change
67 - on_pull_requests: false
.travis/create_artifacts.sh
+2
@@ -11,6 +11,8 @@ fi
11 # See https://github.com/travis-ci/travis-ci/issues/4704#issuecomment-348435959 for details.
12 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);'
13 echo "--- Create tarball ---"
14 +autoreconf -ivf
15 +./configure
16 make dist
17 echo "--- Create self-extractor ---"
18 ./makeself/build-x86_64-static.sh
.travis/generate_changelog.sh
+7 -1
@@ -10,6 +10,12 @@ fi
10
11 ORGANIZATION=$(echo "$TRAVIS_REPO_SLUG" | awk -F '/' '{print $1}')
12 PROJECT=$(echo "$TRAVIS_REPO_SLUG" | awk -F '/' '{print $2}')
13 +GIT_MAIL="pawel+bot@netdata.cloud"
14 +GIT_USER="netdatabot"
15 +
16 +echo "--- Initialize git configuration ---"
17 +git config user.email "${GIT_MAIL}"
18 +git config user.name "${GIT_USER}"
19
20 echo "--- Creating changelog ---"
21 git checkout master
@@ -27,4 +33,4 @@ docker run -it -v "$(pwd)":/project markmandel/github-changelog-generator:latest
33 echo "--- Uploading changelog ---"
34 git add CHANGELOG.md
35 git commit -m '[ci skip] Automatic changelog update'
30 -git push "https://${GITHUB_TOKEN}:@${GIT_URL}"
36 +git push "https://${GITHUB_TOKEN}:@$(git config --get remote.origin.url | sed -e 's/^https:\/\///')"
.travis/releaser.sh
+7 -17
@@ -23,27 +23,14 @@
23 # - docker
24 # - git-semver python package (pip install git-semver)
25
26 +set -e
27 +
28 if [ ! -f .gitignore ]
29 then
30 echo "Run as ./travis/$(basename "$0") from top level directory of git repository"
31 exit 1
32 fi
33
32 -echo "---- INITIALIZING CONFIGURATION -----"
33 -# Some basic variables
34 -GIT_MAIL="pawel+bot@netdata.cloud"
35 -GIT_USER="netdatabot"
36 -ORGANIZATION=$(echo "$TRAVIS_REPO_SLUG" | awk -F '/' '{print $1}')
37 -PROJECT=$(echo "$TRAVIS_REPO_SLUG" | awk -F '/' '{print $2}')
38 -HUB_VERSION=${HUB_VERSION:-"2.5.1"}
39 -
40 -# Git config
41 -git config user.email "${GIT_MAIL}"
42 -git config user.name "${GIT_USER}"
43 -GIT_URL=$(git config --get remote.origin.url)
44 -GIT_URL=${GIT_URL#*//}
45 -
46 -
34 echo "---- GENERATING CHANGELOG -----"
35 ./.travis/generate_changelog.sh
36
@@ -51,7 +38,7 @@ echo "---- FIGURING OUT TAGS ----"
38 # Check if current commit is tagged or not
39 GIT_TAG=$(git tag --points-at)
40 if [ -z "${GIT_TAG}" ]; then
54 - git semver || exit 1
41 + git semver
42 # Figure out next tag based on commit message
43 GIT_TAG=HEAD
44 echo "Last commit message: $TRAVIS_COMMIT_MESSAGE"
@@ -66,7 +53,8 @@ if [ -z "${GIT_TAG}" ]; then
53 if [ "$GIT_TAG" != "HEAD" ]; then
54 echo "Assigning a new tag: $GIT_TAG"
55 git tag "$GIT_TAG" -a -m "Automatic tag generation for travis build no. $TRAVIS_BUILD_NUMBER"
69 - git push "https://${GITHUB_TOKEN}:@${GIT_URL}" --tags || exit 0 # exits if tag exists
56 + # git is able to push due to configuration already being initialized in `generate_changelog.sh` script
57 + git push "https://${GITHUB_TOKEN}:@$(git config --get remote.origin.url | sed -e 's/^https:\/\///')" --tags
58 fi
59 fi
60
@@ -78,6 +66,7 @@ if [ "${GIT_TAG}" == "HEAD" ]; then
66 fi
67
68 echo "---- CREATING TAGGED DOCKER CONTAINERS ----"
69 +export REPOSITORY="netdata/netdata"
70 ./docker/build.sh
71
72 echo "---- CREATING RELEASE ARTIFACTS -----"
@@ -85,6 +74,7 @@ echo "---- CREATING RELEASE ARTIFACTS -----"
74
75 echo "---- CREATING RELEASE DRAFT WITH ASSETS -----"
76 # Download hub
77 +HUB_VERSION=${HUB_VERSION:-"2.5.1"}
78 wget "https://github.com/github/hub/releases/download/v${HUB_VERSION}/hub-linux-amd64-${HUB_VERSION}.tgz" -O "/tmp/hub-linux-amd64-${HUB_VERSION}.tgz"
79 tar -C /tmp -xvf "/tmp/hub-linux-amd64-${HUB_VERSION}.tgz"
80 export PATH=$PATH:"/tmp/hub-linux-amd64-${HUB_VERSION}/bin"
docker/build.sh
+11 -5
@@ -6,13 +6,19 @@
6
7 set -e
8
9 -REPOSITORY="${REPOSITORY:-netdata}"
10 -
11 -VERSION=$(git tag --points-at)
9 +if [ "$1" == "" ]; then
10 + VERSION=$(git tag --points-at)
11 +else
12 + VERSION="$1"
13 +fi
14 if [ "${VERSION}" == "" ]; then
15 VERSION="latest"
16 fi
17
18 +REPOSITORY="${REPOSITORY:-netdata}"
19 +
20 +echo "Building $VERSION of netdata container"
21 +
22 declare -A ARCH_MAP
23 ARCH_MAP=( ["i386"]="386" ["amd64"]="amd64" ["armhf"]="arm" ["aarch64"]="arm64")
24
@@ -72,6 +78,6 @@ if [ "$REPOSITORY" != "netdata" ]; then
78 docker tag "${REPOSITORY}:${VERSION}-${ARCH}" "firehol/netdata:${ARCH}"
79 docker push "firehol/netdata:${ARCH}"
80 done
75 - docker tag "${REPOSITORY}:latest-amd64" "firehol/netdata:latest"
76 - docker push "firehol/netdata:latest"
81 + docker tag "${REPOSITORY}:${VERSION}-amd64" "firehol/netdata:${VERSION}"
82 + docker push "firehol/netdata:${VERSION}"
83 fi