diff options
-rwxr-xr-x | build-artifacts.sh | 27 | ||||
-rwxr-xr-x | packaging/installer/netdata-updater.sh | 11 |
2 files changed, 33 insertions, 5 deletions
diff --git a/build-artifacts.sh b/build-artifacts.sh new file mode 100755 index 0000000000..a759efd6ca --- /dev/null +++ b/build-artifacts.sh @@ -0,0 +1,27 @@ +#!/bin/sh + +BASENAME="netdata-$(git describe)" + +mkdir -p artifacts + +autoreconf -ivf +./configure \ + --prefix=/usr \ + --sysconfdir=/etc \ + --localstatedir=/var \ + --libexecdir=/usr/libexec \ + --with-zlib \ + --with-math \ + --with-user=netdata \ + CFLAGS=-O2 +make dist +mv "${BASENAME}.tar.gz" artifacts/ + +USER="" ./packaging/makeself/build-x86_64-static.sh + +cp packaging/version artifacts/latest-version.txt + +cd artifacts || exit 1 +ln -s "${BASENAME}.tar.gz" netdata-latest.tar.gz +ln -s "${BASENAME}.gz.run" netdata-latest.gz.run +sha256sum -b ./* > "sha256sums.txt" diff --git a/packaging/installer/netdata-updater.sh b/packaging/installer/netdata-updater.sh index 7e2b630a23..3cabc95a08 100755 --- a/packaging/installer/netdata-updater.sh +++ b/packaging/installer/netdata-updater.sh @@ -131,8 +131,8 @@ set_tarball_urls() { export NETDATA_TARBALL_URL="https://github.com/netdata/netdata/releases/download/$latest/netdata-$latest.${extension}" export NETDATA_TARBALL_CHECKSUM_URL="https://github.com/netdata/netdata/releases/download/$latest/sha256sums.txt" else - export NETDATA_TARBALL_URL="$NETDATA_TARBALL_BASEURL/netdata-latest.${extension}" - export NETDATA_TARBALL_CHECKSUM_URL="$NETDATA_TARBALL_BASEURL/sha256sums.txt" + export NETDATA_TARBALL_URL="$NETDATA_NIGHTLIES_BASEURL/netdata-latest.${extension}" + export NETDATA_TARBALL_CHECKSUM_URL="$NETDATA_NIGHTLIES_BASEURL/sha256sums.txt" fi } @@ -242,8 +242,8 @@ export NETDATA_LIB_DIR="${NETDATA_LIB_DIR:-${NETDATA_PREFIX}/var/lib/netdata}" # Source the tarbal checksum, if not already available from environment (for existing installations with the old logic) [[ -z "${NETDATA_TARBALL_CHECKSUM}" ]] && [[ -f ${NETDATA_LIB_DIR}/netdata.tarball.checksum ]] && NETDATA_TARBALL_CHECKSUM="$(cat "${NETDATA_LIB_DIR}/netdata.tarball.checksum")" -# Netdata Tarball Base URL (defaults to our Google Storage Bucket) -[ -z "$NETDATA_TARBALL_BASEURL" ] && NETDATA_TARBALL_BASEURL=https://storage.googleapis.com/netdata-nightlies +# Grab the nightlies baseurl (defaulting to our Google Storage bucket) +export NETDATA_NIGHTLIES_BASEURL="${NETDATA_NIGHTLIES_BASEURL:-https://storage.googleapis.com/netdata-nightlies}" if [ "${INSTALL_UID}" != "$(id -u)" ]; then fatal "You are running this script as user with uid $(id -u). We recommend to run this script as root (user with uid 0)" @@ -277,7 +277,8 @@ if [ "${IS_NETDATA_STATIC_BINARY}" == "yes" ]; then fi # Do not pass any options other than the accept, for now - if sh "${TMPDIR}/netdata-latest.gz.run" --accept -- "${REINSTALL_OPTIONS}"; then + # shellcheck disable=SC2086 + if sh "${TMPDIR}/netdata-latest.gz.run" --accept -- ${REINSTALL_OPTIONS}; then rm -r "${TMPDIR}" else echo >&2 "NOTE: did not remove: ${TMPDIR}" |