ci: Replaced travis with test suite while setting production setup on ci.

This commit is contained in:
arpit551
2020-04-20 20:24:20 +05:30
committed by Tim Abbott
parent 80af201ef9
commit dee8de3b88
4 changed files with 18 additions and 19 deletions

View File

@@ -6,7 +6,7 @@ set -e
set -x
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
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/
# 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
# Travis CI override settings above
# Circle CI override settings above
AUTHENTICATION_BACKENDS = ( 'zproject.backends.EmailAuthBackend', )
NOREPLY_EMAIL_ADDRESS = 'noreply@travis.example.com'
NOREPLY_EMAIL_ADDRESS = 'noreply@circleci.example.com'
ALLOWED_HOSTS = []
EOF

View File

@@ -9,11 +9,11 @@ set -x
# 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
# once again if that fixes our problem.
tools/provision --production-travis || {
tools/provision --production-test-suite || {
ret=$?
if [ "$ret" = 1 ]; then
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
echo "\`provision\`: Something REALLY BAD went wrong with the provisioning, not retrying."
exit "$ret"
@@ -23,13 +23,12 @@ tools/provision --production-travis || {
cp -a tools/ci/success-http-headers.txt ~/
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"
cat /tmp/tmp.*/update-prod-static.log || true
exit 1
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
# the postgres database to match the prod installation setup will work.

View File

@@ -390,7 +390,7 @@ def main(options: argparse.Namespace) -> "NoReturn":
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", "redis-server", "restart"])
run_as_root(["service", "memcached", "restart"])
@@ -416,7 +416,7 @@ def main(options: argparse.Namespace) -> "NoReturn":
[
provision_inner,
*(["--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,
help="Ignore all provisioning optimizations.")
parser.add_argument('--production-travis', action='store_true',
dest='is_production_travis',
parser.add_argument('--production-test-suite', action='store_true',
dest='is_production_test_suite',
default=False,
help="Provision for Travis with production settings.")
help="Provision for test suite with production settings.")
options = parser.parse_args()
main(options)

View File

@@ -181,8 +181,8 @@ def main(options: argparse.Namespace) -> int:
else:
print("No need to run `scripts/setup/inline_email_css.py`.")
if not options.is_production_travis:
# The following block is skipped for the production Travis
if not options.is_production_test_suite:
# The following block is skipped for the production test
# suite, because that suite doesn't make use of these elements
# of the development environment (it just uses the development
# environment to build a release tarball).
@@ -280,10 +280,10 @@ if __name__ == "__main__":
default=False,
help="Ignore all provisioning optimizations.")
parser.add_argument('--production-travis', action='store_true',
dest='is_production_travis',
parser.add_argument('--production-test-suite', action='store_true',
dest='is_production_test_suite',
default=False,
help="Provision for Travis with production settings.")
help="Provision for test suite with production settings.")
options = parser.parse_args()
sys.exit(main(options))