summaryrefslogtreecommitdiffstats
path: root/.travis
diff options
context:
space:
mode:
authorPaul Emm. Katsoulakis <34388743+paulkatsoulakis@users.noreply.github.com>2019-07-28 10:54:46 +0300
committerGitHub <noreply@github.com>2019-07-28 10:54:46 +0300
commit864d25d07e784e2154e5580d0edd10b357f4dd34 (patch)
treed7fb1b720c9eb7a47f7d54ec3873ab5a55946bd7 /.travis
parentbc8cca877884d07936a6e412afb8a7057ee6794b (diff)
netdata/packaging: Notify us when CHANGELOG.md gets too old (#6556)
* netdata/packaging: [ci skip] Make sure you notify us when nightlies changelog generation fails. It is a soft error, but we do want to know about it
Diffstat (limited to '.travis')
-rwxr-xr-x.travis/check_changelog_last_modification.sh21
1 files changed, 21 insertions, 0 deletions
diff --git a/.travis/check_changelog_last_modification.sh b/.travis/check_changelog_last_modification.sh
new file mode 100755
index 0000000000..2665c06279
--- /dev/null
+++ b/.travis/check_changelog_last_modification.sh
@@ -0,0 +1,21 @@
+#!/usr/bin/env bash
+
+set -e
+
+LAST_MODIFICATION="$(git log -1 --pretty="format:%at" CHANGELOG.md)"
+CURRENT_TIME="$(date +"%s")"
+TWO_DAYS_IN_SECONDS=172800
+
+DIFF=$((CURRENT_TIME - LAST_MODIFICATION))
+
+echo "Checking CHANGELOG.md last modification time on GIT.."
+echo "CHANGELOG.md timestamp: ${LAST_MODIFICATION}"
+echo "Current timestamp: ${CURRENT_TIME}"
+echo "Diff: ${DIFF}"
+
+if [ ${DIFF} -gt ${TWO_DAYS_IN_SECONDS} ]; then
+ echo "CHANGELOG.md is more than two days old!"
+ post_message "TRAVIS_MESSAGE" "Hi <!here>, CHANGELOG.md was found more than two days old (Diff: ${DIFF} seconds)" "${NOTIF_CHANNEL}"
+else
+ echo "CHANGELOG.md is less than two days old, fine"
+fi