Skip to content

armgit / zulip

Public Imported from GitHub
0

Zulip server and web application. Open-source team chat that helps teams stay productive and focused.

ci: Test upgrading PostgreSQL 10 -> 12.

Alex Vandiver2540b678b0a3
diff --git a/.circleci/config.yml b/.circleci/config.yml
index 672c1eac109..ef178c668f8 100644
--- a/.circleci/config.yml
+++ b/.circleci/config.yml
@@ -144,6 +144,12 @@ aliases:
command: |
sudo mispipe "/tmp/production-verify 2>&1" ts
+ - &upgrade_postgresql
+ run:
+ name: upgrade postgresql
+ command: |
+ sudo mispipe "/tmp/production-upgrade-pg 2>&1" ts
+
- &check_xenial_provision_error
run:
name: check tools/provision error message on xenial
@@ -297,6 +303,7 @@ jobs:
- success-http-headers-focal.txt
- production-install
- production-verify
+ - production-upgrade-pg
- production
- production-extract-tarball
- *notify_failure_status
@@ -321,6 +328,8 @@ jobs:
- *restore_cache_package_json
- *install_production
- *verify_production
+ - *upgrade_postgresql
+ - *verify_production
- *save_cache_package_json
- *notify_failure_status
diff --git a/tools/ci/production-build b/tools/ci/production-build
index d33b8114332..e08f2634680 100755
--- a/tools/ci/production-build
+++ b/tools/ci/production-build
@@ -36,6 +36,7 @@ cp -a \
tools/ci/success-http-headers-focal.txt \
tools/ci/production-install \
tools/ci/production-verify \
+ tools/ci/production-upgrade-pg \
tools/ci/production-extract-tarball \
\
/tmp/
diff --git a/tools/ci/production-install b/tools/ci/production-install
index ff6371eef65..c76564cb897 100755
--- a/tools/ci/production-install
+++ b/tools/ci/production-install
@@ -20,8 +20,20 @@ if ! apt-get dist-upgrade -y "${APT_OPTIONS[@]}"; then
apt-get dist-upgrade -y "${APT_OPTIONS[@]}"
fi
+# Pin to postgresql 10 on Bionic, so we can test upgrading it
+if [ "$os_version_codename" = "bionic" ]; then
+ export POSTGRES_VERSION=10
+fi
+
# Install Zulip
"$ZULIP_PATH"/scripts/setup/install --self-signed-cert --hostname 127.0.0.1 --email [email protected]
+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
+
echo "Production installation complete!"
exit 0
diff --git a/tools/ci/production-upgrade-pg b/tools/ci/production-upgrade-pg
new file mode 100755
index 00000000000..fc81843ca4c
--- /dev/null
+++ b/tools/ci/production-upgrade-pg
@@ -0,0 +1,13 @@
+#!/usr/bin/env bash
+# This tests upgrading PostgreSQL
+set -e
+set -x
+
+ZULIP_PATH=/home/circleci/zulip
+
+supervisorctl stop all
+"$ZULIP_PATH"/scripts/setup/upgrade-postgres
+supervisorctl start all
+
+echo "Upgrade of PostgreSQL complete!"
+exit 0