summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorpaulfantom <pawel@krupa.net.pl>2018-11-01 19:25:11 +0100
committerpaulfantom <pawel@krupa.net.pl>2018-11-02 14:11:53 +0100
commit70de8647b92cfa8761cdb97e22f8d952cdd78303 (patch)
treef28bb0cb0ece5ba93842f600cdc399802e08a1ff
parent9ba9c8c9bcf6c8e4e4b1413d1a1a6c93f44477de (diff)
fix CI scripts configuration and [netdata minor release] and [minor] (just to be sure)
-rw-r--r--.travis.yml9
-rwxr-xr-x.travis/create_artifacts.sh2
-rwxr-xr-x.travis/generate_changelog.sh8
-rwxr-xr-x.travis/releaser.sh24
-rwxr-xr-xdocker/build.sh16
5 files changed, 32 insertions, 27 deletions
diff --git a/.travis.yml b/.travis.yml
index 3a7f7948e0..42acd454c3 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -42,15 +42,18 @@ jobs:
- stage: packaging
name: Create release
- install: sudo apt-get install -y gnupg libcap2-bin zlib1g-dev uuid-dev fakeroot python-pip
+ 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
before_script: sudo pip install git-semver
script: ".travis/releaser.sh"
+ git:
+ depth: false
+ if: type != cron
- name: Nightly tarball and self-extractor build
install: sudo apt-get install -y gnupg libcap2-bin zlib1g-dev uuid-dev fakeroot
script: ".travis/firehol_create_artifacts.sh"
if: type = cron
- name: Nightly docker images
- install: sudo apt update -y && sudo apt install -y --only-upgrade docker-ce && docker info
+ install: sudo apt update -y && sudo apt install -y --only-upgrade docker-ce && docker info
script: "docker/build.sh"
env: REPOSITORY="netdata/netdata"
if: type = cron
@@ -63,5 +66,3 @@ notifications:
webhooks: https://app.fossa.io/hooks/travisci
slack:
secure: Ntl1GNjgGDdmMQsudDi/4+co6zRV8znJXOB0joLVHNV1icHvUSMKShgpY08AoWoxNYMDVHXOUzEGwiZd6MI4MleNu9gwtACwgXe+sDjgBIDvQYC6JQS7XlANJfzBlZnrGnaiVVlBmI/LajgABCsrTAYV8gVrq2zA3u56UrNwS3qRJnbaqGgH64SnHbdllHQ7l7Qcc/27voy6Op32oJhDZ5bVY5CRZUR42oPvlDx9PSD0yqSkLwFrIE0Qg+mTVDZ4Watrv8iv91ghc6GwwPvNGShcYI04P8hn08FZ4eGH47K4AZf97IDargmxPsEwkOhgcl3w4J5KHZzmVb7hsEs6+iZz4KulD2u4D/xy5BGUcRZKMuyiO99dmZO61wP0Ra0Wzfe0exG+LFxAmC0jiYS67xL0YWs2SKkO7iftthI8NX1Lus1PGleBpJ28LKQdZjaKz3w2xIRlJ45eEdwBgtnNkW68NsmJCflrNkAlaVW6+zCPMpT4rT41rpkh0Fl+YbvOhH/S3VfiTY7OqTU5B9ttgJuN/m8PWi8g5MKO2C1TWkK3cV4O2PnpugtioHuTuj2X/AKOrh7hlefedDxPZPIxFmLi3OKtgHBzwzQk79p6V9ffbbVfsO+p8kiKJuc8s0v6d++Rt2FLXwUquJGDKC0hz8cAMSUiFaP5t1TlhTk7LJ4=
- on_success: change
- on_pull_requests: false
diff --git a/.travis/create_artifacts.sh b/.travis/create_artifacts.sh
index 6e545fdddf..40ba9c85f7 100755
--- a/.travis/create_artifacts.sh
+++ b/.travis/create_artifacts.sh
@@ -11,6 +11,8 @@ fi
# 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 ---"
+autoreconf -ivf
+./configure
make dist
echo "--- Create self-extractor ---"
./makeself/build-x86_64-static.sh
diff --git a/.travis/generate_changelog.sh b/.travis/generate_changelog.sh
index d367a0ecdd..bc8be1023b 100755
--- a/.travis/generate_changelog.sh
+++ b/.travis/generate_changelog.sh
@@ -10,6 +10,12 @@ fi
ORGANIZATION=$(echo "$TRAVIS_REPO_SLUG" | awk -F '/' '{print $1}')
PROJECT=$(echo "$TRAVIS_REPO_SLUG" | awk -F '/' '{print $2}')
+GIT_MAIL="pawel+bot@netdata.cloud"
+GIT_USER="netdatabot"
+
+echo "--- Initialize git configuration ---"
+git config user.email "${GIT_MAIL}"
+git config user.name "${GIT_USER}"
echo "--- Creating changelog ---"
git checkout master
@@ -27,4 +33,4 @@ docker run -it -v "$(pwd)":/project markmandel/github-changelog-generator:latest
echo "--- Uploading changelog ---"
git add CHANGELOG.md
git commit -m '[ci skip] Automatic changelog update'
-git push "https://${GITHUB_TOKEN}:@${GIT_URL}"
+git push "https://${GITHUB_TOKEN}:@$(git config --get remote.origin.url | sed -e 's/^https:\/\///')"
diff --git a/.travis/releaser.sh b/.travis/releaser.sh
index 8bb202c2d2..9f7ecd4eed 100755
--- a/.travis/releaser.sh
+++ b/.travis/releaser.sh
@@ -23,27 +23,14 @@
# - docker
# - git-semver python package (pip install git-semver)
+set -e
+
if [ ! -f .gitignore ]
then
echo "Run as ./travis/$(basename "$0") from top level directory of git repository"
exit 1
fi
-echo "---- INITIALIZING CONFIGURATION -----"
-# Some basic variables
-GIT_MAIL="pawel+bot@netdata.cloud"
-GIT_USER="netdatabot"
-ORGANIZATION=$(echo "$TRAVIS_REPO_SLUG" | awk -F '/' '{print $1}')
-PROJECT=$(echo "$TRAVIS_REPO_SLUG" | awk -F '/' '{print $2}')
-HUB_VERSION=${HUB_VERSION:-"2.5.1"}
-
-# Git config
-git config user.email "${GIT_MAIL}"
-git config user.name "${GIT_USER}"
-GIT_URL=$(git config --get remote.origin.url)
-GIT_URL=${GIT_URL#*//}
-
-
echo "---- GENERATING CHANGELOG -----"
./.travis/generate_changelog.sh
@@ -51,7 +38,7 @@ echo "---- FIGURING OUT TAGS ----"
# Check if current commit is tagged or not
GIT_TAG=$(git tag --points-at)
if [ -z "${GIT_TAG}" ]; then
- git semver || exit 1
+ git semver
# Figure out next tag based on commit message
GIT_TAG=HEAD
echo "Last commit message: $TRAVIS_COMMIT_MESSAGE"
@@ -66,7 +53,8 @@ if [ -z "${GIT_TAG}" ]; then
if [ "$GIT_TAG" != "HEAD" ]; then
echo "Assigning a new tag: $GIT_TAG"
git tag "$GIT_TAG" -a -m "Automatic tag generation for travis build no. $TRAVIS_BUILD_NUMBER"
- git push "https://${GITHUB_TOKEN}:@${GIT_URL}" --tags || exit 0 # exits if tag exists
+ # git is able to push due to configuration already being initialized in `generate_changelog.sh` script
+ git push "https://${GITHUB_TOKEN}:@$(git config --get remote.origin.url | sed -e 's/^https:\/\///')" --tags
fi
fi
@@ -78,6 +66,7 @@ if [ "${GIT_TAG}" == "HEAD" ]; then
fi
echo "---- CREATING TAGGED DOCKER CONTAINERS ----"
+export REPOSITORY="netdata/netdata"
./docker/build.sh
echo "---- CREATING RELEASE ARTIFACTS -----"
@@ -85,6 +74,7 @@ echo "---- CREATING RELEASE ARTIFACTS -----"
echo "---- CREATING RELEASE DRAFT WITH ASSETS -----"
# Download hub
+HUB_VERSION=${HUB_VERSION:-"2.5.1"}
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"
tar -C /tmp -xvf "/tmp/hub-linux-amd64-${HUB_VERSION}.tgz"
export PATH=$PATH:"/tmp/hub-linux-amd64-${HUB_VERSION}/bin"
diff --git a/docker/build.sh b/docker/build.sh
index 93069e97fa..908468d394 100755
--- a/docker/build.sh
+++ b/docker/build.sh
@@ -6,13 +6,19 @@
set -e
-REPOSITORY="${REPOSITORY:-netdata}"
-
-VERSION=$(git tag --points-at)
+if [ "$1" == "" ]; then
+ VERSION=$(git tag --points-at)
+else
+ VERSION="$1"
+fi
if [ "${VERSION}" == "" ]; then
VERSION="latest"
fi
+REPOSITORY="${REPOSITORY:-netdata}"
+
+echo "Building $VERSION of netdata container"
+
declare -A ARCH_MAP
ARCH_MAP=( ["i386"]="386" ["amd64"]="amd64" ["armhf"]="arm" ["aarch64"]="arm64")
@@ -72,6 +78,6 @@ if [ "$REPOSITORY" != "netdata" ]; then
docker tag "${REPOSITORY}:${VERSION}-${ARCH}" "firehol/netdata:${ARCH}"
docker push "firehol/netdata:${ARCH}"
done
- docker tag "${REPOSITORY}:latest-amd64" "firehol/netdata:latest"
- docker push "firehol/netdata:latest"
+ docker tag "${REPOSITORY}:${VERSION}-amd64" "firehol/netdata:${VERSION}"
+ docker push "firehol/netdata:${VERSION}"
fi