2021-06-07 09:12:58 +02:00
|
|
|
#!/usr/bin/env bash
|
|
|
|
# Given a Zulip production environment that had been installed with a
|
|
|
|
# previous version of Zulip, upgrade it to the commit being tested.
|
|
|
|
# This takes as input the tarball generated by production-build.
|
|
|
|
set -e
|
|
|
|
set -x
|
|
|
|
|
|
|
|
# Structurally, this script should just call upgrade-zulip. However,
|
|
|
|
# because of a set of issues that result in the previously installed
|
|
|
|
# GitHub Actions Docker containers not actually working on boot, we
|
|
|
|
# need to do some preparatory steps. It is a goal to delete these
|
|
|
|
# steps.
|
|
|
|
|
2021-07-28 09:56:02 +02:00
|
|
|
# Reinstall rabbitmq-server.
|
2021-06-07 09:12:58 +02:00
|
|
|
#
|
|
|
|
# * For rabbitmq-server, we likely need to do this to work around the
|
|
|
|
# hostname changing on reboot causing RabbitMQ to not boot.
|
2021-07-28 09:56:02 +02:00
|
|
|
sudo apt-get -y purge rabbitmq-server
|
|
|
|
sudo apt-get -y install rabbitmq-server
|
2021-06-07 09:12:58 +02:00
|
|
|
|
|
|
|
# Start the postgresql service.
|
|
|
|
sudo service postgresql start
|
|
|
|
|
|
|
|
# Starting the rabbitmq-server
|
|
|
|
if ! sudo service rabbitmq-server start; then
|
|
|
|
echo
|
|
|
|
echo "Starting rabbitmq-server failed. Trying again:"
|
|
|
|
sudo service rabbitmq-server start
|
|
|
|
fi
|
|
|
|
|
2021-07-28 09:56:02 +02:00
|
|
|
# Start the supervisor
|
|
|
|
sudo service supervisor start
|
2021-06-07 09:12:58 +02:00
|
|
|
|
|
|
|
# Zulip releases before 2.1.8/3.5/4.4 have a bug in their
|
|
|
|
# `upgrade-zulip` scripts, resulting in them exiting with status 0
|
|
|
|
# unconditionally. We work around that by running
|
|
|
|
# scripts/lib/upgrade-zulip instead.
|
|
|
|
UPGRADE_SCRIPT=/home/zulip/deployments/current/scripts/lib/upgrade-zulip
|
|
|
|
|
|
|
|
# Execute the upgrade.
|
|
|
|
sudo "$UPGRADE_SCRIPT" /tmp/zulip-server-test.tar.gz
|