From 5850810715a9b2fc9413a2b43ae2dc1d1a5b4bf6 Mon Sep 17 00:00:00 2001 From: maneamarius Date: Tue, 3 May 2022 11:06:01 +0300 Subject: [PATCH] Rename --install option for kickstart.sh (#12798) * replace --install flag with --install-prefix and update documentation * fix * minor fix --- netdata-installer.sh | 11 ++++++++++- packaging/installer/kickstart.sh | 12 +++++++++--- packaging/installer/methods/kickstart.md | 3 ++- 3 files changed, 21 insertions(+), 5 deletions(-) diff --git a/netdata-installer.sh b/netdata-installer.sh index a5bbab9690..736fafdba7 100755 --- a/netdata-installer.sh +++ b/netdata-installer.sh @@ -161,6 +161,10 @@ banner_nonroot_install() { Please set an installation prefix, like this: + $PROGRAM ${@} --install-prefix /tmp + + or + $PROGRAM ${@} --install /tmp or, run the installer as root: @@ -199,7 +203,8 @@ usage() { USAGE: ${PROGRAM} [options] where options include: - --install Install netdata in . Ex. --install /opt will put netdata in /opt/netdata. + --install Install netdata in . Ex. --install /opt will put netdata in /opt/netdata, this option is deprecated and will be removed in a future version, please use --install-prefix instead. + --install-prefix Install netdata in . Ex. --install-prefix /opt will put netdata in /opt/netdata. --dont-start-it Do not (re)start netdata after installation. --dont-wait Run installation in non-interactive mode. --stable-channel Use packages from GitHub release pages instead of nightly updates. @@ -370,6 +375,10 @@ while [ -n "${1}" ]; do NETDATA_PREFIX="${2}/netdata" shift 1 ;; + "--install-prefix") + NETDATA_PREFIX="${2}/netdata" + shift 1 + ;; "--install-no-prefix") NETDATA_PREFIX="${2}" shift 1 diff --git a/packaging/installer/kickstart.sh b/packaging/installer/kickstart.sh index 44b1ad7717..a17beee6a1 100755 --- a/packaging/installer/kickstart.sh +++ b/packaging/installer/kickstart.sh @@ -135,7 +135,8 @@ USAGE: kickstart.sh [options] --reinstall-even-if-unsafe Even try to reinstall if we don't think we can do so safely (implies --reinstall). --disable-cloud Disable support for Netdata Cloud (default: detect) --require-cloud Only install if Netdata Cloud can be enabled. Overrides --disable-cloud. - --install Specify an installation prefix for local builds (default: autodetect based on system type). + --install This option is deprecated and will be removed in a future version, use --install-prefix instead. + --install-prefix Specify an installation prefix for local builds (default: autodetect based on system type). --old-install-prefix Specify an old local builds installation prefix for uninstall/reinstall (if it's not default). --claim-token Use a specified token for claiming to Netdata Cloud. --claim-rooms When claiming, add the node to the specified rooms. @@ -920,11 +921,11 @@ EOF confirm_install_prefix() { if [ -n "${INSTALL_PREFIX}" ] && [ "${NETDATA_ONLY_BUILD}" -ne 1 ]; then - fatal "The \`--install\` option is only supported together with the \`--build-only\` option." F0204 + fatal "The \`--install-prefix\` and \`--install\` options are only supported together with the \`--build-only\` option." F0204 fi if [ -n "${INSTALL_PREFIX}" ]; then - NETDATA_INSTALLER_OPTIONS="${NETDATA_INSTALLER_OPTIONS} --install ${INSTALL_PREFIX}" + NETDATA_INSTALLER_OPTIONS="${NETDATA_INSTALLER_OPTIONS} --install-prefix ${INSTALL_PREFIX}" else case "${SYSTYPE}" in Darwin) @@ -1742,6 +1743,11 @@ while [ -n "${1}" ]; do NETDATA_INSTALLER_OPTIONS="${NETDATA_INSTALLER_OPTIONS} --disable-telemetry" ;; "--install") + warning "--install flag is deprecated and will be removed in a future version. Please use --install-prefix instead." + INSTALL_PREFIX="${2}" + shift 1 + ;; + "--install-prefix") INSTALL_PREFIX="${2}" shift 1 ;; diff --git a/packaging/installer/methods/kickstart.md b/packaging/installer/methods/kickstart.md index 78a149fc3e..e14e7b6777 100644 --- a/packaging/installer/methods/kickstart.md +++ b/packaging/installer/methods/kickstart.md @@ -63,7 +63,8 @@ The `kickstart.sh` script accepts a number of optional parameters to control how - `--disable-cloud`: For local builds, don’t build any of the cloud code at all. For native packages and static builds, use runtime configuration to disable cloud support. - `--require-cloud`: Only install if Netdata Cloud can be enabled. Overrides `--disable-cloud`. -- `--install`: Specify an installation prefix for local builds (by default, we use a sane prefix based on the type of system). +- `--install`: Specify an installation prefix for local builds (by default, we use a sane prefix based on the type of system), this option is deprecated and will be removed in a future version, please use `--install-prefix` instead. +- `--install-prefix`: Specify an installation prefix for local builds (by default, we use a sane prefix based on the type of system). - `--old-install-prefix`: Specify the custom local build's installation prefix that should be removed. - `--uninstall`: Uninstall an existing installation of Netdata. - `--reinstall-clean`: Performs an uninstall of Netdata and clean installation.