install: Add system_requirements_failure helper.

Signed-off-by: Anders Kaseorg <anders@zulip.com>
This commit is contained in:
Anders Kaseorg 2023-06-01 13:38:44 -07:00 committed by Tim Abbott
parent b5e5728112
commit 37040ac49d
1 changed files with 14 additions and 14 deletions

View File

@ -49,6 +49,18 @@ Options:
EOF EOF
} }
system_requirements_failure() {
set +x
echo >&2
cat >&2
cat <<EOF >&2
For more information, see:
https://zulip.readthedocs.io/en/latest/production/requirements.html
EOF
exit 1
}
# Shell option parsing. Over time, we'll want to move some of the # Shell option parsing. Over time, we'll want to move some of the
# environment variables below into this self-documenting system. # environment variables below into this self-documenting system.
args="$(getopt -o '' --long help,hostname:,email:,certbot,self-signed-cert,cacert:,postgresql-database-name:,postgresql-database-user:,postgresql-version:,postgresql-missing-dictionaries,no-init-db,no-overwrite-settings,no-dist-upgrade -n "$0" -- "$@")" args="$(getopt -o '' --long help,hostname:,email:,certbot,self-signed-cert,cacert:,postgresql-database-name:,postgresql-database-user:,postgresql-version:,postgresql-missing-dictionaries,no-init-db,no-overwrite-settings,no-dist-upgrade -n "$0" -- "$@")"
@ -221,9 +233,7 @@ fi
case "$os_id $os_version_id" in case "$os_id $os_version_id" in
'debian 11' | 'debian 12' | 'ubuntu 20.04' | 'ubuntu 22.04') ;; 'debian 11' | 'debian 12' | 'ubuntu 20.04' | 'ubuntu 22.04') ;;
*) *)
set +x system_requirements_failure <<EOF
cat <<EOF
Unsupported OS release: $os_id $os_version_id Unsupported OS release: $os_id $os_version_id
Zulip in production is supported only on: Zulip in production is supported only on:
@ -231,11 +241,7 @@ Zulip in production is supported only on:
- Debian 12 - Debian 12
- Ubuntu 20.04 LTS - Ubuntu 20.04 LTS
- Ubuntu 22.04 LTS - Ubuntu 22.04 LTS
For more information, see:
https://zulip.readthedocs.io/en/latest/production/requirements.html
EOF EOF
exit 1
;; ;;
esac esac
@ -245,19 +251,13 @@ has_universe() {
} }
if [ "$os_id" = ubuntu ] && ! has_universe && ! { apt-get update && has_universe; }; then if [ "$os_id" = ubuntu ] && ! has_universe && ! { apt-get update && has_universe; }; then
set +x system_requirements_failure <<EOF
cat <<'EOF'
You must enable the Ubuntu Universe repository before installing You must enable the Ubuntu Universe repository before installing
Zulip. You can do this with: Zulip. You can do this with:
sudo add-apt-repository universe sudo add-apt-repository universe
sudo apt update sudo apt update
For more information, see:
https://zulip.readthedocs.io/en/latest/production/requirements.html
EOF EOF
exit 1
fi fi
case ",$PUPPET_CLASSES," in case ",$PUPPET_CLASSES," in