From 3b95e5be69c199a2a195c57aba12d88c242225ac Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Wed, 17 Apr 2019 19:57:35 +0200 Subject: Adding upstream version 1.14.0~rc0. Signed-off-by: Daniel Baumann --- .travis/nightlies.sh | 74 +++++++++++++++++++++++++++------------------------- 1 file changed, 38 insertions(+), 36 deletions(-) (limited to '.travis/nightlies.sh') diff --git a/.travis/nightlies.sh b/.travis/nightlies.sh index 8e867416e..0d9fe036a 100755 --- a/.travis/nightlies.sh +++ b/.travis/nightlies.sh @@ -1,45 +1,47 @@ #!/bin/bash - -BAD_THING_HAPPENED=0 - -if [ ! -f .gitignore ]; then - echo "Run as ./travis/$(basename "$0") from top level directory of git repository" - exit 1 +# +# This is the nightlies orchastration script +# It runs the following activities in order: +# 1) Generate changelog +# 2) Build docker images +# 3) Publish docker images +# 4) Generate the rest of the artifacts (Source code .tar.gz file and makeself binary generation) +# +# Copyright: SPDX-License-Identifier: GPL-3.0-or-later +# +# Author : Pawel Krupa (paulfantom) +# Author : Pavlos Emm. Katsoulakis (paul@netdata.cloud) +set -e + +FAIL=0 + +# If we are not in netdata git repo, at the top level directory, fail +TOP_LEVEL=$(basename "$(git rev-parse --show-toplevel)") +CWD=$(git rev-parse --show-cdup || echo "") +if [ -n "${CWD}" ] || [ ! "${TOP_LEVEL}" == "netdata" ]; then + echo "Run as .travis/$(basename "$0") from top level directory of netdata git repository" + echo "Changelog generation process aborted" + exit 1 fi -export GIT_MAIL="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) -if [ "$NO_COMMITS" == "$(rev packaging/version -git add packaging/version || exit 1 - -echo "--- GENERATE CHANGELOG ---" -if .travis/generate_changelog.sh; then - 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:\/\///')" -else - git clean -xfd - BAD_THING_HAPPENED=1 -fi -echo "--- BUILD & PUBLISH DOCKER IMAGES ---" -export REPOSITORY="netdata/netdata" -packaging/docker/build.sh || BAD_THING_HAPPENED=1 +echo "--- Running Changelog generation ---" +.travis/generate_changelog.sh "${LAST_TAG}" "${COMMITS_SINCE_RELEASE}" || echo "Changelog generation has failed, this is a soft error, process continues" + +echo "--- Build && publish docker images ---" +# Do not fail artifacts creation if docker fails. We will be restructuring this on a follow up PR +packaging/docker/build.sh && packaging/docker/publish.sh || echo "Failed to build and publish docker images" -echo "--- BUILD ARTIFACTS ---" -.travis/create_artifacts.sh || BAD_THING_HAPPENED=1 +echo "--- Build artifacts ---" +.travis/create_artifacts.sh -exit "${BAD_THING_HAPPENED}" +exit "${FAIL}" -- cgit v1.2.3