mirror of
https://github.com/zulip/zulip.git
synced 2025-11-01 20:44:04 +00:00
ci: Replaced travis with test suite while setting production setup on ci.
This commit is contained in:
@@ -6,7 +6,7 @@ set -e
|
|||||||
set -x
|
set -x
|
||||||
|
|
||||||
ZULIP_PATH=$(mktemp -d)
|
ZULIP_PATH=$(mktemp -d)
|
||||||
tar -xf zulip-server-travis.tar.gz -C "$ZULIP_PATH" --strip-components=1
|
tar -xf zulip-server-test.tar.gz -C "$ZULIP_PATH" --strip-components=1
|
||||||
|
|
||||||
# Do an apt upgrade to start with an up-to-date machine
|
# Do an apt upgrade to start with an up-to-date machine
|
||||||
APT_OPTIONS=(-o 'Dpkg::Options::=--force-confdef' -o 'Dpkg::Options::=--force-confold')
|
APT_OPTIONS=(-o 'Dpkg::Options::=--force-confdef' -o 'Dpkg::Options::=--force-confold')
|
||||||
@@ -22,12 +22,12 @@ service rabbitmq-server stop
|
|||||||
rm -rf /var/lib/rabbitmq/mnesia/
|
rm -rf /var/lib/rabbitmq/mnesia/
|
||||||
|
|
||||||
# Install Zulip
|
# Install Zulip
|
||||||
env TRAVIS=1 "$ZULIP_PATH"/scripts/setup/install --self-signed-cert --hostname 127.0.0.1 --email zulip-travis-admin@travis.example.com
|
env TRAVIS=1 "$ZULIP_PATH"/scripts/setup/install --self-signed-cert --hostname 127.0.0.1 --email circleci@example.com
|
||||||
|
|
||||||
cat >>/etc/zulip/settings.py <<EOF
|
cat >>/etc/zulip/settings.py <<EOF
|
||||||
# Travis CI override settings above
|
# Circle CI override settings above
|
||||||
AUTHENTICATION_BACKENDS = ( 'zproject.backends.EmailAuthBackend', )
|
AUTHENTICATION_BACKENDS = ( 'zproject.backends.EmailAuthBackend', )
|
||||||
NOREPLY_EMAIL_ADDRESS = 'noreply@travis.example.com'
|
NOREPLY_EMAIL_ADDRESS = 'noreply@circleci.example.com'
|
||||||
ALLOWED_HOSTS = []
|
ALLOWED_HOSTS = []
|
||||||
EOF
|
EOF
|
||||||
|
|
||||||
|
|||||||
@@ -9,11 +9,11 @@ set -x
|
|||||||
# Provisioning may fail due to many issues but most of the times a network
|
# Provisioning may fail due to many issues but most of the times a network
|
||||||
# connection issue is the reason. So we are going to retry entire provisioning
|
# connection issue is the reason. So we are going to retry entire provisioning
|
||||||
# once again if that fixes our problem.
|
# once again if that fixes our problem.
|
||||||
tools/provision --production-travis || {
|
tools/provision --production-test-suite || {
|
||||||
ret=$?
|
ret=$?
|
||||||
if [ "$ret" = 1 ]; then
|
if [ "$ret" = 1 ]; then
|
||||||
echo "\`provision\`: Something went wrong with the provisioning, might be a network issue, Retrying to provision..."
|
echo "\`provision\`: Something went wrong with the provisioning, might be a network issue, Retrying to provision..."
|
||||||
tools/provision --production-travis
|
tools/provision --production-test-suite
|
||||||
else
|
else
|
||||||
echo "\`provision\`: Something REALLY BAD went wrong with the provisioning, not retrying."
|
echo "\`provision\`: Something REALLY BAD went wrong with the provisioning, not retrying."
|
||||||
exit "$ret"
|
exit "$ret"
|
||||||
@@ -23,13 +23,12 @@ tools/provision --production-travis || {
|
|||||||
cp -a tools/ci/success-http-headers.txt ~/
|
cp -a tools/ci/success-http-headers.txt ~/
|
||||||
source tools/ci/activate-venv
|
source tools/ci/activate-venv
|
||||||
|
|
||||||
if ! env TRAVIS=1 ./tools/build-release-tarball travis; then
|
if ! env TRAVIS=1 ./tools/build-release-tarball test; then
|
||||||
echo "Attempting to output failure logging data"
|
echo "Attempting to output failure logging data"
|
||||||
cat /tmp/tmp.*/update-prod-static.log || true
|
cat /tmp/tmp.*/update-prod-static.log || true
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
mv /tmp/tmp.*/zulip-server-travis.tar.gz ./
|
mv /tmp/tmp.*/zulip-server-test.tar.gz ./
|
||||||
|
|
||||||
|
|
||||||
# Shut down all services so that restarting postgres and rebuilding
|
# Shut down all services so that restarting postgres and rebuilding
|
||||||
# the postgres database to match the prod installation setup will work.
|
# the postgres database to match the prod installation setup will work.
|
||||||
|
|||||||
@@ -390,7 +390,7 @@ def main(options: argparse.Namespace) -> "NoReturn":
|
|||||||
|
|
||||||
run_as_root(["cp", REPO_STOPWORDS_PATH, TSEARCH_STOPWORDS_PATH])
|
run_as_root(["cp", REPO_STOPWORDS_PATH, TSEARCH_STOPWORDS_PATH])
|
||||||
|
|
||||||
if is_circleci or (is_travis and not options.is_production_travis):
|
if is_circleci and not options.is_production_test_suite:
|
||||||
run_as_root(["service", "rabbitmq-server", "restart"])
|
run_as_root(["service", "rabbitmq-server", "restart"])
|
||||||
run_as_root(["service", "redis-server", "restart"])
|
run_as_root(["service", "redis-server", "restart"])
|
||||||
run_as_root(["service", "memcached", "restart"])
|
run_as_root(["service", "memcached", "restart"])
|
||||||
@@ -416,7 +416,7 @@ def main(options: argparse.Namespace) -> "NoReturn":
|
|||||||
[
|
[
|
||||||
provision_inner,
|
provision_inner,
|
||||||
*(["--force"] if options.is_force else []),
|
*(["--force"] if options.is_force else []),
|
||||||
*(["--production-travis"] if options.is_production_travis else []),
|
*(["--production-test-suite"] if options.is_production_test_suite else []),
|
||||||
]
|
]
|
||||||
)
|
)
|
||||||
|
|
||||||
@@ -427,10 +427,10 @@ if __name__ == "__main__":
|
|||||||
default=False,
|
default=False,
|
||||||
help="Ignore all provisioning optimizations.")
|
help="Ignore all provisioning optimizations.")
|
||||||
|
|
||||||
parser.add_argument('--production-travis', action='store_true',
|
parser.add_argument('--production-test-suite', action='store_true',
|
||||||
dest='is_production_travis',
|
dest='is_production_test_suite',
|
||||||
default=False,
|
default=False,
|
||||||
help="Provision for Travis with production settings.")
|
help="Provision for test suite with production settings.")
|
||||||
|
|
||||||
options = parser.parse_args()
|
options = parser.parse_args()
|
||||||
main(options)
|
main(options)
|
||||||
|
|||||||
@@ -181,8 +181,8 @@ def main(options: argparse.Namespace) -> int:
|
|||||||
else:
|
else:
|
||||||
print("No need to run `scripts/setup/inline_email_css.py`.")
|
print("No need to run `scripts/setup/inline_email_css.py`.")
|
||||||
|
|
||||||
if not options.is_production_travis:
|
if not options.is_production_test_suite:
|
||||||
# The following block is skipped for the production Travis
|
# The following block is skipped for the production test
|
||||||
# suite, because that suite doesn't make use of these elements
|
# suite, because that suite doesn't make use of these elements
|
||||||
# of the development environment (it just uses the development
|
# of the development environment (it just uses the development
|
||||||
# environment to build a release tarball).
|
# environment to build a release tarball).
|
||||||
@@ -280,10 +280,10 @@ if __name__ == "__main__":
|
|||||||
default=False,
|
default=False,
|
||||||
help="Ignore all provisioning optimizations.")
|
help="Ignore all provisioning optimizations.")
|
||||||
|
|
||||||
parser.add_argument('--production-travis', action='store_true',
|
parser.add_argument('--production-test-suite', action='store_true',
|
||||||
dest='is_production_travis',
|
dest='is_production_test_suite',
|
||||||
default=False,
|
default=False,
|
||||||
help="Provision for Travis with production settings.")
|
help="Provision for test suite with production settings.")
|
||||||
|
|
||||||
options = parser.parse_args()
|
options = parser.parse_args()
|
||||||
sys.exit(main(options))
|
sys.exit(main(options))
|
||||||
|
|||||||
Reference in New Issue
Block a user