0
0
Fork 0
mirror of https://github.com/netdata/netdata.git synced 2025-04-07 23:05:41 +00:00
netdata_netdata/tests/installer/checksums.sh
Austin S. Hemmelgarn 486ee8a1a3
Initial release of new kickstart script. ()
* Replace existing kickstart scripts with kickstart-ng.

This change looks more complicated than it actually is due to git not
sanely recognizing the rename.

* Fix CI for new kickstart script.

* Initial revision of install documentation.

* Further documentation updates.

* Even more documentation updates.

* Fix telemetry event handling if neither curl nor wget are installed.

* Remove dependence on `pgrep` for claiming.

* Fix fatal error message handling.

* Formally outline our support policy.

* Updates to platform support doc.

* Platform support doc updates.

* Minor documentation updates.

* Remove accidentally commited file from rebase process.

* Apply suggestions from code review, part 1.

Co-authored-by: Tina Luedtke <kickoke@users.noreply.github.com>

* Made one-line installer consistent.

* Apply suggestions from code review, part 2.

* Update architecture list for static builds.

* Restructure platform support doc so that things are clearer.

Especially for cases of linking directly to the section on a specific
support category.

* Apply suggestions from code review, part 3.

Co-authored-by: Tina Luedtke <kickoke@users.noreply.github.com>

* Apply suggestions from code review, part 4

Co-authored-by: Tina Luedtke <kickoke@users.noreply.github.com>

* Further updates to platform support document.

* Further documentation updates.

* Rework update documentation.

Co-authored-by: Tina Luedtke <kickoke@users.noreply.github.com>
2022-01-18 08:30:21 -05:00

53 lines
1.7 KiB
Bash
Executable file

#!/bin/sh
#
# 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)
# Author : Austin S. Hemmelgarn (austin@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
check_file() {
README_MD5=$(grep "$1" "$2" | grep md5sum | grep curl | cut -d '"' -f2)
KICKSTART_URL="https://my-netdata.io/$1"
KICKSTART="packaging/installer/$1"
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
echo "${KICKSTART_URL} md5sum does not match local file, it needs to be updated"
exit 2
fi
fi
echo "Validating documentation for $1"
if [ "$KICKSTART_MD5" != "$README_MD5" ]; then
echo "Invalid checksum for $1 in $2."
echo "checksum in docs: $README_MD5"
echo "current checksum: $KICKSTART_MD5"
exit 2
else
echo "$1 MD5Sum is well documented"
fi
}
check_file kickstart.sh packaging/installer/methods/kickstart.md
echo "No problems found, exiting successfully!"