2018-12-18 02:08:53 +01:00
|
|
|
#!/usr/bin/env bash
|
2017-06-06 03:15:17 +02:00
|
|
|
# This test installs a Zulip production environment (from the release
|
2020-06-27 01:17:52 +02:00
|
|
|
# tarball from production-build).
|
2015-10-15 01:47:42 +02:00
|
|
|
set -e
|
|
|
|
set -x
|
|
|
|
|
2020-07-08 21:01:15 +02:00
|
|
|
ZULIP_PATH=/home/github/zulip
|
2015-10-15 01:47:42 +02:00
|
|
|
|
2016-01-19 20:44:21 +01:00
|
|
|
# Do an apt upgrade to start with an up-to-date machine
|
2018-08-03 02:14:51 +02:00
|
|
|
APT_OPTIONS=(-o 'Dpkg::Options::=--force-confdef' -o 'Dpkg::Options::=--force-confold')
|
2016-05-02 23:34:49 +02:00
|
|
|
apt-get update
|
2016-06-22 17:59:34 +02:00
|
|
|
|
2020-05-25 20:54:15 +02:00
|
|
|
if [ -f /etc/os-release ]; then
|
2021-04-02 09:42:33 +02:00
|
|
|
# This is a temporary hack to test Debian Bullseye systems as
|
|
|
|
# though Bullseye was already released, so we don't need to
|
|
|
|
# change all of our scripts to parse bullseye/sid.
|
|
|
|
check_pretty_name="$(
|
|
|
|
. /etc/os-release
|
|
|
|
printf '%s\n' "$PRETTY_NAME"
|
|
|
|
)"
|
|
|
|
{ read -r pretty_name; } <<<"$check_pretty_name"
|
|
|
|
|
|
|
|
if [ "$pretty_name" = "Debian GNU/Linux bullseye/sid" ]; then
|
|
|
|
echo "VERSION_CODENAME=bullseye" | tee -a >>/etc/os-release
|
|
|
|
echo "VERSION_ID=\"11\"" | tee -a >>/etc/os-release
|
|
|
|
fi
|
|
|
|
# End hack
|
|
|
|
|
2020-10-15 04:55:57 +02:00
|
|
|
os_info="$(
|
|
|
|
. /etc/os-release
|
|
|
|
printf '%s\n' "$VERSION_CODENAME"
|
|
|
|
)"
|
|
|
|
{ read -r os_version_codename || true; } <<<"$os_info"
|
2020-05-25 20:54:15 +02:00
|
|
|
fi
|
|
|
|
|
2018-08-03 02:14:51 +02:00
|
|
|
if ! apt-get dist-upgrade -y "${APT_OPTIONS[@]}"; then
|
2020-03-28 01:25:56 +01:00
|
|
|
echo "\`apt-get dist-upgrade\`: Failure occurred while trying to perform distribution upgrade, Retrying..."
|
2018-08-03 02:14:51 +02:00
|
|
|
apt-get dist-upgrade -y "${APT_OPTIONS[@]}"
|
2017-06-13 19:04:46 +02:00
|
|
|
fi
|
travis: Remove rabbitmq nodename dependency on hostname.
Because rabbitmq doesn't support changing the nodename of a running
rabbitmq node, Zulip installations suffered a plague of issues where
e.g. a Zulip server would reboot, the hostname would change, and
suddenly the local rabbitmq instance being used by Zulip would stop
working.
We address this problem by using, by default, a fixed rabbitmq
nodename, but providing server administrators the option to set the
rabbitmq nodename used by Zulip however they choose.
To upgrade an existing server to use this new configuration, one will
need to add something like the following to /etc/zulip/zulip.conf:
[rabbitmq]
nodename = zulip@localhost
However, I don't believe we have the puppet code in place to make this
work correctly at initial installation without rabbitmq-server being
already installed (but off), as we can easily setup in Travis CI but I
haven't been willing to do for the installer. So for now, this just
fixes our Travis CI problems.
Fixes: #1579.
2016-08-10 03:40:07 +02:00
|
|
|
|
2020-10-23 02:43:28 +02:00
|
|
|
# Pin to PostgreSQL 10 on Bionic, so we can test upgrading it
|
2020-06-27 01:26:18 +02:00
|
|
|
if [ "$os_version_codename" = "bionic" ]; then
|
2020-10-26 22:35:47 +01:00
|
|
|
export POSTGRESQL_VERSION=10
|
2020-06-27 01:26:18 +02:00
|
|
|
fi
|
|
|
|
|
2016-01-10 00:13:12 +01:00
|
|
|
# Install Zulip
|
2020-04-21 22:51:04 +02:00
|
|
|
"$ZULIP_PATH"/scripts/setup/install --self-signed-cert --hostname 127.0.0.1 --email circleci@example.com
|
2015-10-15 01:47:42 +02:00
|
|
|
|
2020-06-27 01:26:18 +02:00
|
|
|
if [ "$os_version_codename" = "bionic" ]; then
|
|
|
|
if [ "$(crudini --get /etc/zulip/zulip.conf postgresql version)" != "10" ]; then
|
|
|
|
echo "Installer did not install the PostgreSQL 10 that we asked for!"
|
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
|
2020-06-27 01:17:52 +02:00
|
|
|
echo "Production installation complete!"
|
2016-05-08 03:49:43 +02:00
|
|
|
exit 0
|