summaryrefslogtreecommitdiffstats
path: root/.travis
diff options
context:
space:
mode:
authorPaul Emm. Katsoulakis <34388743+paulkatsoulakis@users.noreply.github.com>2019-08-16 09:19:47 +0300
committerGitHub <noreply@github.com>2019-08-16 09:19:47 +0300
commit4292f8d9d52fc0fc4adffaddff1dae34168da012 (patch)
tree0a77a2a4356890cf878cec42605408c2db41294c /.travis
parent7648928e7db8b12a52e03ee0f4f05602c986701b (diff)
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
Diffstat (limited to '.travis')
-rwxr-xr-x.travis/trigger_package_generation.sh52
1 files changed, 52 insertions, 0 deletions
diff --git a/.travis/trigger_package_generation.sh b/.travis/trigger_package_generation.sh
new file mode 100755
index 0000000000..fd5161f5a9
--- /dev/null
+++ b/.travis/trigger_package_generation.sh
@@ -0,0 +1,52 @@
+#!/usr/bin/env bash
+#
+# Trigger .RPM and .DEB package generation processes
+#
+# Copyright: SPDX-License-Identifier: GPL-3.0-or-later
+#
+# Author: Pavlos Emm. Katsoulakis <paul@netdata.cloud>
+set -e
+WAIT_TIME=15
+BUILD_NIGHTLY="$1"
+
+commit_change() {
+ local ARCH="$1"
+ local PKG="$2"
+
+ echo "---- Committing ${ARCH} .${PKG} package generation ----"
+ git commit --allow-empty -m "[Package ${ARCH} ${PKG}]${BUILD_NIGHTLY} Package build process trigger"
+}
+
+push_change() {
+ local GIT_MAIL="bot@netdata.cloud"
+ local GIT_USER="netdatabot"
+
+ echo "---- Push changes to repository ----"
+ git commit -m "[ci skip] release $GIT_TAG" --author "${GIT_USER} <${GIT_MAIL}>"
+ git push "https://${GITHUB_TOKEN}:@$(git config --get remote.origin.url | sed -e 's/^https:\/\///')"
+}
+
+# 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
+
+echo "--- Initialize git configuration ---"
+git checkout master
+git fetch --all
+git pull
+
+commit_change "amd64" "DEB"
+push_change
+
+echo "---- Waiting for ${WAIT_TIME} seconds before triggering next process ----"
+sleep "${WAIT_TIME}"
+
+commit_channge "amd64" "RPM"
+push_change
+
+echo "---- Done! ----"