mirror of
https://github.com/zulip/zulip.git
synced 2025-11-09 08:26:11 +00:00
ci: Update CI to test once with custom db name and user.
Update CI to test once with a custom db name and user so we can test both scenarios of a custom dbname/user and the default "zulip".
This commit is contained in:
8
.github/workflows/production-suite.yml
vendored
8
.github/workflows/production-suite.yml
vendored
@@ -113,24 +113,28 @@ jobs:
|
|||||||
# Base images are built using `tools/ci/Dockerfile.template`.
|
# Base images are built using `tools/ci/Dockerfile.template`.
|
||||||
# The comments at the top explain how to build and upload these images.
|
# The comments at the top explain how to build and upload these images.
|
||||||
- docker_image: zulip/ci:bionic
|
- docker_image: zulip/ci:bionic
|
||||||
name: Bionic production install
|
name: Bionic production install with custom db name and user
|
||||||
is_bionic: true
|
is_bionic: true
|
||||||
os: bionic
|
os: bionic
|
||||||
|
install-command: /tmp/production-install --test-custom-db
|
||||||
|
|
||||||
- docker_image: zulip/ci:focal
|
- docker_image: zulip/ci:focal
|
||||||
name: Focal production install
|
name: Focal production install
|
||||||
is_focal: true
|
is_focal: true
|
||||||
os: focal
|
os: focal
|
||||||
|
install-command: /tmp/production-install
|
||||||
|
|
||||||
- docker_image: zulip/ci:buster
|
- docker_image: zulip/ci:buster
|
||||||
name: Buster production install
|
name: Buster production install
|
||||||
is_buster: true
|
is_buster: true
|
||||||
os: buster
|
os: buster
|
||||||
|
install-command: /tmp/production-install
|
||||||
|
|
||||||
- docker_image: zulip/ci:bullseye
|
- docker_image: zulip/ci:bullseye
|
||||||
name: Bullseye production install
|
name: Bullseye production install
|
||||||
is_bullseye: true
|
is_bullseye: true
|
||||||
os: bullseye
|
os: bullseye
|
||||||
|
install-command: /tmp/production-install
|
||||||
|
|
||||||
name: ${{ matrix.name }}
|
name: ${{ matrix.name }}
|
||||||
container: ${{ matrix.docker_image }}
|
container: ${{ matrix.docker_image }}
|
||||||
@@ -181,7 +185,7 @@ jobs:
|
|||||||
- name: Install production
|
- name: Install production
|
||||||
run: |
|
run: |
|
||||||
sudo service rabbitmq-server restart
|
sudo service rabbitmq-server restart
|
||||||
sudo /tmp/production-install
|
sudo ${{ matrix.install-command }}
|
||||||
|
|
||||||
- name: Verify install
|
- name: Verify install
|
||||||
run: sudo /tmp/production-verify
|
run: sudo /tmp/production-verify
|
||||||
|
|||||||
@@ -4,6 +4,41 @@
|
|||||||
set -e
|
set -e
|
||||||
set -x
|
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
|
ZULIP_PATH=/root/zulip-latest
|
||||||
mkdir -p "$ZULIP_PATH"
|
mkdir -p "$ZULIP_PATH"
|
||||||
tar -xf /tmp/zulip-server-test.tar.gz -C "$ZULIP_PATH" --strip-components=1
|
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
|
export POSTGRESQL_VERSION=10
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Install Zulip
|
# Install
|
||||||
"$ZULIP_PATH"/scripts/setup/install --self-signed-cert --hostname 127.0.0.1 --email circleci@example.com
|
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 [ "$os_version_codename" = "bionic" ]; then
|
||||||
if [ "$(crudini --get /etc/zulip/zulip.conf postgresql version)" != "10" ]; then
|
if [ "$(crudini --get /etc/zulip/zulip.conf postgresql version)" != "10" ]; then
|
||||||
|
|||||||
Reference in New Issue
Block a user