diff --git a/.github/workflows/production-suite.yml b/.github/workflows/production-suite.yml index 1e5588c695..6c9e419c6c 100644 --- a/.github/workflows/production-suite.yml +++ b/.github/workflows/production-suite.yml @@ -113,24 +113,28 @@ jobs: # Base images are built using `tools/ci/Dockerfile.template`. # The comments at the top explain how to build and upload these images. - docker_image: zulip/ci:bionic - name: Bionic production install + name: Bionic production install with custom db name and user is_bionic: true os: bionic + install-command: /tmp/production-install --test-custom-db - docker_image: zulip/ci:focal name: Focal production install is_focal: true os: focal + install-command: /tmp/production-install - docker_image: zulip/ci:buster name: Buster production install is_buster: true os: buster + install-command: /tmp/production-install - docker_image: zulip/ci:bullseye name: Bullseye production install is_bullseye: true os: bullseye + install-command: /tmp/production-install name: ${{ matrix.name }} container: ${{ matrix.docker_image }} @@ -181,7 +185,7 @@ jobs: - name: Install production run: | sudo service rabbitmq-server restart - sudo /tmp/production-install + sudo ${{ matrix.install-command }} - name: Verify install run: sudo /tmp/production-verify diff --git a/tools/ci/production-install b/tools/ci/production-install index 24dc986b20..232494b22f 100755 --- a/tools/ci/production-install +++ b/tools/ci/production-install @@ -4,6 +4,41 @@ set -e set -x +usage() { + cat <<'EOF' +Usage: + production-install + production-install --test-custom-db + production-install --help + +Options: + --test-custom-db + This will instruct the install test to be ran with a custom database name and user. + +EOF +} + +# Shell option parsing. +args="$(getopt -o '' --long help,test-custom-db -n "$0" -- "$@")" +eval "set -- $args" +while true; do + case "$1" in + --help) + usage + exit 0 + ;; + + --test-custom-db) + TEST_CUSTOM_DB=1 + shift + ;; + --) + shift + break + ;; + esac +done + ZULIP_PATH=/root/zulip-latest mkdir -p "$ZULIP_PATH" tar -xf /tmp/zulip-server-test.tar.gz -C "$ZULIP_PATH" --strip-components=1 @@ -45,8 +80,14 @@ if [ "$os_version_codename" = "bionic" ]; then export POSTGRESQL_VERSION=10 fi -# Install Zulip -"$ZULIP_PATH"/scripts/setup/install --self-signed-cert --hostname 127.0.0.1 --email circleci@example.com +# Install +if [ -z "$TEST_CUSTOM_DB" ]; then + echo "Testing production install with default database name and user." + "$ZULIP_PATH"/scripts/setup/install --self-signed-cert --hostname 127.0.0.1 --email circleci@example.com +else + echo "Testing production install with custom database name and user." + "$ZULIP_PATH"/scripts/setup/install --self-signed-cert --hostname 127.0.0.1 --email circleci@example.com --postgresql-database-user zulipcustomuser --postgresql-database-name zulipcustomdb +fi if [ "$os_version_codename" = "bionic" ]; then if [ "$(crudini --get /etc/zulip/zulip.conf postgresql version)" != "10" ]; then