netdata/packaging: Add auto-generation of packages for nightly (#6675)
force pushing before approvals, i will be closely monitoring the effect by triggering nightlies on demand and evaluate the result
Paul Emm. Katsoulakis committed
Aug 16, 2019 at 09:19 UTC
4292f8d9d52fc0fc4adffaddff1dae34168da012
2 files changed
+58
.travis.yml
+6
@@ -541,6 +541,12 @@ jobs:
541
#
542
- stage: Nightly release
543
544
+ name: Trigger .RPM and .DEB package generatioa
545
+ before_script: post_message "TRAVIS_MESSAGE" "Starting RPM and DEB package generation for nightlies" "${NOTIF_CHANNEL}"
546
+ script:
547
+ - .travis/trigger_package_generation.sh "[Build latest]"
548
+ after_failure: post_message "TRAVIS_MESSAGE" "<!here> Nightly package generation produced errors" "${NOTIF_CHANNEL}"
549
+
550
name: Build & Publish docker images
551
before_script: post_message "TRAVIS_MESSAGE" "Publishing docker images for nightlies" "${NOTIF_CHANNEL}"
552
script:
.travis/trigger_package_generation.sh
new
+52
@@ -0,0 +1,52 @@
1
+#!/usr/bin/env bash
2
+#
3
+# Trigger .RPM and .DEB package generation processes
4
+#
5
+# Copyright: SPDX-License-Identifier: GPL-3.0-or-later
6
+#
7
+# Author: Pavlos Emm. Katsoulakis <paul@netdata.cloud>
8
+set -e
9
+WAIT_TIME=15
10
+BUILD_NIGHTLY="$1"
11
+
12
+commit_change() {
13
+ local ARCH="$1"
14
+ local PKG="$2"
15
+
16
+ echo "---- Committing ${ARCH} .${PKG} package generation ----"
17
+ git commit --allow-empty -m "[Package ${ARCH} ${PKG}]${BUILD_NIGHTLY} Package build process trigger"
18
+}
19
+
20
+push_change() {
21
+ local GIT_MAIL="bot@netdata.cloud"
22
+ local GIT_USER="netdatabot"
23
+
24
+ echo "---- Push changes to repository ----"
25
+ git commit -m "[ci skip] release $GIT_TAG" --author "${GIT_USER} <${GIT_MAIL}>"
26
+ git push "https://${GITHUB_TOKEN}:@$(git config --get remote.origin.url | sed -e 's/^https:\/\///')"
27
+}
28
+
29
+# If we are not in netdata git repo, at the top level directory, fail
30
+TOP_LEVEL=$(basename "$(git rev-parse --show-toplevel)")
31
+CWD=$(git rev-parse --show-cdup || echo "")
32
+if [ -n "${CWD}" ] || [ ! "${TOP_LEVEL}" == "netdata" ]; then
33
+ echo "Run as .travis/$(basename "$0") from top level directory of netdata git repository"
34
+ echo "Changelog generation process aborted"
35
+ exit 1
36
+fi
37
+
38
+echo "--- Initialize git configuration ---"
39
+git checkout master
40
+git fetch --all
41
+git pull
42
+
43
+commit_change "amd64" "DEB"
44
+push_change
45
+
46
+echo "---- Waiting for ${WAIT_TIME} seconds before triggering next process ----"
47
+sleep "${WAIT_TIME}"
48
+
49
+commit_channge "amd64" "RPM"
50
+push_change
51
+
52
+echo "---- Done! ----"