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 --- tests/installer/checksums.sh | 51 ++++++++++++++++++++++++++++++++++++++++++++ tests/installer/slack.sh | 16 ++++++++++++++ 2 files changed, 67 insertions(+) create mode 100755 tests/installer/checksums.sh create mode 100755 tests/installer/slack.sh (limited to 'tests/installer') diff --git a/tests/installer/checksums.sh b/tests/installer/checksums.sh new file mode 100755 index 000000000..b2759bd5f --- /dev/null +++ b/tests/installer/checksums.sh @@ -0,0 +1,51 @@ +#!/bin/bash +# +# Mechanism to validate kickstart files integrity status +# +# Copyright: SPDX-License-Identifier: GPL-3.0-or-later +# +# Author : Pawel Krupa (pawel@netdata.cloud) +# Author : Pavlos Emm. Katsoulakis (paul@netdata.cloud) +set -e + +# If we are not in netdata git repo, at the top level directory, fail +TOP_LEVEL=$(basename "$(git rev-parse --show-toplevel 2> /dev/null || echo "")") +CWD="$(git rev-parse --show-cdup 2> /dev/null || echo "")" +if [ -n "$CWD" ] || [ ! "${TOP_LEVEL}" == "netdata" ]; then + echo "Run as ./tests/installer/$(basename "$0") from top level directory of netdata git repository" + echo "Kickstart validation process aborted" + exit 1 +fi + +README_DOC="packaging/installer/README.md" +source ./tests/installer/slack.sh + +for file in kickstart.sh kickstart-static64.sh; do + README_MD5=$(grep "$file" $README_DOC | grep md5sum | cut -d '"' -f2) + KICKSTART_URL="https://my-netdata.io/$file" + KICKSTART="packaging/installer/$file" + KICKSTART_MD5="$(md5sum "${KICKSTART}" | cut -d' ' -f1)" + CALCULATED_MD5="$(curl -Ss ${KICKSTART_URL} | md5sum | cut -d ' ' -f 1)" + + # Conditionally run the website validation + if [ -z "${LOCAL_ONLY}" ]; then + echo "Validating ${KICKSTART_URL} against local file ${KICKSTART} with MD5 ${KICKSTART_MD5}.." + if [ "$KICKSTART_MD5" == "$CALCULATED_MD5" ]; then + echo "${KICKSTART_URL} looks fine" + else + post_message "Attention @group , ${KICKSTART_URL} md5sum does not match local file, it needs to be updated" + fi + fi + + echo "Validating documentation for $file" + if [ "$KICKSTART_MD5" != "$README_MD5" ]; then + echo "Invalid checksum for $file in $README_DOC." + echo "checksum in docs: $README_MD5" + echo "current checksum: $KICKSTART_MD5" + exit 2 + else + echo "$file MD5Sum is well documented" + fi + +done +echo "No problems found, exiting succesfully!" diff --git a/tests/installer/slack.sh b/tests/installer/slack.sh new file mode 100755 index 000000000..a5a17a747 --- /dev/null +++ b/tests/installer/slack.sh @@ -0,0 +1,16 @@ +# #No shebang necessary +# BASH Lib: Simple incoming webhook for slack integration. +# +# The script expects the following parameters to be defined by the upper layer: +# SLACK_INCOMING_WEBHOOK_URL +# SLACK_BOT_NAME +# SLACK_CHANNEL +# +# Copyright: +# +# Author: Pavlos Emm. Katsoulakis