diff options
author | Austin S. Hemmelgarn <austin@netdata.cloud> | 2023-01-16 08:17:51 -0500 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-01-16 08:17:51 -0500 |
commit | e5be62dcbcb4729d87c0a68c58b31a220b98b1c1 (patch) | |
tree | a3f8ada302285e085a3d6eab53c2cdb17f2be277 /packaging/installer/kickstart.sh | |
parent | a14a21f90f7f38ff2b71eb3bc0b442d240c09fd6 (diff) |
Switch nightlies to GitHub releases. (#14020)
* Switch nightlies to GitHub releases.
Instead of using GCS.
* Fix CI handling.
* Fix handling of download URLs for nightly builds.
* Fix handling of redirects for consolidated artifact checks.
* Avoid redirect issues with the test environment.
* Add more info to logs for updater checks.
* Ignore redirect issues for updater checks.
* Fix base URL handling in updater.
* Dump post-update info in CI before checking if the update worked.
* Special-case a version of `latest` in updater.
This is to allow CI to work correctly.
* Update nightly release badge in README.md.
* Fix updater check variable name.
* Add a comment documenting the magic number in parse_version.
Diffstat (limited to 'packaging/installer/kickstart.sh')
-rwxr-xr-x | packaging/installer/kickstart.sh | 49 |
1 files changed, 22 insertions, 27 deletions
diff --git a/packaging/installer/kickstart.sh b/packaging/installer/kickstart.sh index bb4c678f08..001567c0ab 100755 --- a/packaging/installer/kickstart.sh +++ b/packaging/installer/kickstart.sh @@ -65,7 +65,7 @@ else NETDATA_DISABLE_TELEMETRY=0 fi -NETDATA_TARBALL_BASEURL="${NETDATA_TARBALL_BASEURL:-https://storage.googleapis.com/netdata-nightlies}" +NETDATA_TARBALL_BASEURL="${NETDATA_TARBALL_BASEURL:-https://github.com/netdata/netdata-nightlies/releases}" TELEMETRY_API_KEY="${NETDATA_POSTHOG_API_KEY:-mqkwGT0JNFqO-zX2t0mW6Tec9yooaVu7xCBlXtHnt5Y}" if echo "${0}" | grep -q 'kickstart-static64'; then @@ -1574,25 +1574,33 @@ set_static_archive_urls() { if [ -n "${NETDATA_OFFLINE_INSTALL_SOURCE}" ]; then path="$(cd "${NETDATA_OFFLINE_INSTALL_SOURCE}" || exit 1; pwd)" export NETDATA_STATIC_ARCHIVE_URL="file://${path}/netdata-${arch}-latest.gz.run" + export NETDATA_STATIC_ARCHIVE_NAME="netdata-${arch}-latest.gz.run" export NETDATA_STATIC_ARCHIVE_CHECKSUM_URL="file://${path}/sha256sums.txt" elif [ "${1}" = "stable" ]; then if [ -n "${INSTALL_VERSION}" ]; then - export NETDATA_STATIC_ARCHIVE_OLD_URL="https://github.com/netdata/netdata/releases/download/v${INSTALL_VERSION}/netdata-v${INSTALL_VERSION}.gz.run" export NETDATA_STATIC_ARCHIVE_URL="https://github.com/netdata/netdata/releases/download/v${INSTALL_VERSION}/netdata-${arch}-v${INSTALL_VERSION}.gz.run" + export NETDATA_STATIC_ARCHIVE_OLD_URL="https://github.com/netdata/netdata/releases/download/v${INSTALL_VERSION}/netdata-v${INSTALL_VERSION}.gz.run" + export NETDATA_STATIC_ARCHIVE_NAME="netdata-${arch}-v${INSTALL_VERSION}.gz.run" + export NETDATA_STATIC_ARCHIVE_OLD_NAME="netdata-v${INSTALL_VERSION}.gz.run" export NETDATA_STATIC_ARCHIVE_CHECKSUM_URL="https://github.com/netdata/netdata/releases/download/v${INSTALL_VERSION}/sha256sums.txt" else latest="$(get_redirect "https://github.com/netdata/netdata/releases/latest")" export NETDATA_STATIC_ARCHIVE_URL="https://github.com/netdata/netdata/releases/download/${latest}/netdata-${arch}-latest.gz.run" + export NETDATA_STATIC_ARCHIVE_NAME="netdata-${arch}-latest.gz.run" export NETDATA_STATIC_ARCHIVE_CHECKSUM_URL="https://github.com/netdata/netdata/releases/download/${latest}/sha256sums.txt" fi else if [ -n "${INSTALL_VERSION}" ]; then - export NETDATA_STATIC_ARCHIVE_URL="${NETDATA_TARBALL_BASEURL}/netdata-${arch}-v${INSTALL_VERSION}.gz.run" - export NETDATA_STATIC_ARCHIVE_OLD_URL="${NETDATA_TARBALL_BASEURL}/netdata-v${INSTALL_VERSION}.gz.run" - export NETDATA_STATIC_ARCHIVE_CHECKSUM_URL="${NETDATA_TARBALL_BASEURL}/sha256sums.txt" + export NETDATA_STATIC_ARCHIVE_URL="${NETDATA_TARBALL_BASEURL}/download/v${INSTALL_VERSION}/netdata-${arch}-v${INSTALL_VERSION}.gz.run" + export NETDATA_STATIC_ARCHIVE_OLD_URL="${NETDATA_TARBALL_BASEURL}/download/v${INSTALL_VERSION}/netdata-v${INSTALL_VERSION}.gz.run" + export NETDATA_STATIC_ARCHIVE_NAME="netdata-${arch}-v${INSTALL_VERSION}.gz.run" + export NETDATA_STATIC_ARCHIVE_OLD_NAME="netdata-v${INSTALL_VERSION}.gz.run" + export NETDATA_STATIC_ARCHIVE_CHECKSUM_URL="${NETDATA_TARBALL_BASEURL}/download/v${INSTALL_VERSION}/sha256sums.txt" else - export NETDATA_STATIC_ARCHIVE_URL="${NETDATA_TARBALL_BASEURL}/netdata-${arch}-latest.gz.run" - export NETDATA_STATIC_ARCHIVE_CHECKSUM_URL="${NETDATA_TARBALL_BASEURL}/sha256sums.txt" + tag="$(get_redirect "${NETDATA_TARBALL_BASEURL}/latest")" + export NETDATA_STATIC_ARCHIVE_URL="${NETDATA_TARBALL_BASEURL}/download/${tag}/netdata-${arch}-latest.gz.run" + export NETDATA_STATIC_ARCHIVE_NAME="netdata-${arch}-latest.gz.run" + export NETDATA_STATIC_ARCHIVE_CHECKSUM_URL="${NETDATA_TARBALL_BASEURL}/download/${tag}/sha256sums.txt" fi fi } @@ -1607,23 +1615,9 @@ try_static_install() { # Check status code first, so that we can provide nicer fallback for dry runs. if check_for_remote_file "${NETDATA_STATIC_ARCHIVE_URL}"; then - if [ -n "${NETDATA_OFFLINE_INSTALL_SOURCE}" ]; then - netdata_agent="$(basename "${NETDATA_STATIC_ARCHIVE_URL#"file://"}")" - elif [ -n "${INSTALL_VERSION}" ]; then - if [ "${SELECTED_RELEASE_CHANNEL}" = "stable" ]; then - netdata_agent="${NETDATA_STATIC_ARCHIVE_URL#"https://github.com/netdata/netdata/releases/download/v${INSTALL_VERSION}/"}" - else - netdata_agent="${NETDATA_STATIC_ARCHIVE_URL#"${NETDATA_TARBALL_BASEURL}/"}" - fi - else - if [ "${SELECTED_RELEASE_CHANNEL}" = "stable" ]; then - netdata_agent="${NETDATA_STATIC_ARCHIVE_URL#"https://github.com/netdata/netdata/releases/download/${latest}/"}" - else - netdata_agent="${NETDATA_STATIC_ARCHIVE_URL#"${NETDATA_TARBALL_BASEURL}/"}" - fi - fi + netdata_agent="${NETDATA_STATIC_ARCHIVE_NAME}" elif [ "${SYSARCH}" = "x86_64" ] && check_for_remote_file "${NETDATA_STATIC_ARCHIVE_OLD_URL}"; then - netdata_agent="${NETDATA_STATIC_ARCHIVE_OLD_URL#"https://github.com/netdata/netdata/releases/download/v${INSTALL_VERSION}/"}" + netdata_agent="${NETDATA_STATIC_ARCHIVE_OLD_NAME}" export NETDATA_STATIC_ARCHIVE_URL="${NETDATA_STATIC_ARCHIVE_OLD_URL}" else warning "There is no static build available for ${SYSARCH} CPUs. This usually means we simply do not currently provide static builds for ${SYSARCH} CPUs." @@ -1692,11 +1686,12 @@ set_source_archive_urls() { fi else if [ -n "${INSTALL_VERSION}" ]; then - export NETDATA_SOURCE_ARCHIVE_URL="${NETDATA_TARBALL_BASEURL}/netdata-v${INSTALL_VERSION}.tar.gz" - export NETDATA_SOURCE_ARCHIVE_CHECKSUM_URL="${NETDATA_TARBALL_BASEURL}/sha256sums.txt" + export NETDATA_SOURCE_ARCHIVE_URL="${NETDATA_TARBALL_BASEURL}/download/v${INSTALL_VERSION}/netdata-latest.tar.gz" + export NETDATA_SOURCE_ARCHIVE_CHECKSUM_URL="${NETDATA_TARBALL_BASEURL}/download/v${INSTALL_VERSION}/sha256sums.txt" else - export NETDATA_SOURCE_ARCHIVE_URL="${NETDATA_TARBALL_BASEURL}/netdata-latest.tar.gz" - export NETDATA_SOURCE_ARCHIVE_CHECKSUM_URL="${NETDATA_TARBALL_BASEURL}/sha256sums.txt" + tag="$(get_redirect "${NETDATA_TARBALL_BASEURL}/latest")" + export NETDATA_SOURCE_ARCHIVE_URL="${NETDATA_TARBALL_BASEURL}/download/${tag}/netdata-latest.tar.gz" + export NETDATA_SOURCE_ARCHIVE_CHECKSUM_URL="${NETDATA_TARBALL_BASEURL}/download/${tag}/sha256sums.txt" fi fi } |