Autodetect channel for specific version (#12856)
* autodetect channel * fix kickstart.sh
maneamarius committed
May 18, 2022 at 14:05 UTC
1edfe043708f6fca3b7d9cc578bf876ccf7a1c8e
1 file changed
+27
packaging/installer/kickstart.sh
+27
@@ -105,6 +105,19 @@ main() {
105
progress "Using ${tmpdir} as a temporary directory."
106
cd "${tmpdir}" || fatal "Failed to change current working directory to ${tmpdir}." F000A
107
108
+ if [ -n "${INSTALL_VERSION}" ]; then
109
+ if echo "${INSTALL_VERSION}" | grep -E -o "^[[:digit:]]+\.[[:digit:]]+\.[[:digit:]]+$" > /dev/null 2>&1; then
110
+ NEW_SELECTED_RELEASE_CHANNEL="stable"
111
+ else
112
+ NEW_SELECTED_RELEASE_CHANNEL="nightly"
113
+ fi
114
+
115
+ if ! [ "${NEW_SELECTED_RELEASE_CHANNEL}" = "${SELECTED_RELEASE_CHANNEL}" ]; then
116
+ warning "Selected release channel does not match this version and it will be changed automatically."
117
+ SELECTED_RELEASE_CHANNEL="${NEW_SELECTED_RELEASE_CHANNEL}"
118
+ fi
119
+ fi
120
+
121
case "${SYSTYPE}" in
122
Linux) install_on_linux ;;
123
Darwin) install_on_macos ;;
@@ -1324,6 +1337,20 @@ try_package_install() {
1337
;;
1338
esac
1339
1340
+ if [ -n "${INSTALL_VERSION}" ]; then
1341
+ if echo "${INSTALL_VERSION}" | grep -q "nightly"; then
1342
+ new_release="-edge"
1343
+ else
1344
+ new_release=
1345
+ fi
1346
+
1347
+ if { [ -n "${new_release}" ] && [ -z "${release}" ]; } || { [ -z "${new_release}" ] && [ -n "${release}" ]; }; then
1348
+ warning "Selected release channel does not match this version and it will be changed automatically."
1349
+ fi
1350
+
1351
+ release="${new_release}"
1352
+ fi
1353
+
1354
repoconfig_name="netdata-repo${release}"
1355
repoconfig_file="${repoconfig_name}${pkg_vsep}${REPOCONFIG_VERSION}${pkg_suffix}.${pkg_type}"
1356
repoconfig_url="${REPOCONFIG_URL_PREFIX}/${repo_prefix}/${repoconfig_file}/download.${pkg_type}"