2018-12-18 02:08:53 +01:00
|
|
|
#!/usr/bin/env bash
|
2017-06-06 03:15:17 +02:00
|
|
|
# In short, this provisions a Zulip development environment and then
|
|
|
|
# builds a Zulip release tarball (the same way we build them for an
|
|
|
|
# actual release). The actual test job will then install that.
|
2020-04-20 16:39:21 +02:00
|
|
|
|
2015-10-15 01:47:42 +02:00
|
|
|
set -e
|
|
|
|
set -x
|
|
|
|
|
2017-06-13 21:54:52 +02:00
|
|
|
# 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.
|
2020-06-03 21:07:33 +02:00
|
|
|
tools/provision --build-release-tarball-only || {
|
2019-07-19 03:36:59 +02:00
|
|
|
ret=$?
|
|
|
|
if [ "$ret" = 1 ]; then
|
|
|
|
echo "\`provision\`: Something went wrong with the provisioning, might be a network issue, Retrying to provision..."
|
2020-06-03 21:07:33 +02:00
|
|
|
tools/provision --build-release-tarball-only
|
2019-07-19 03:36:59 +02:00
|
|
|
else
|
|
|
|
echo "\`provision\`: Something REALLY BAD went wrong with the provisioning, not retrying."
|
|
|
|
exit "$ret"
|
|
|
|
fi
|
|
|
|
}
|
2017-01-14 11:19:26 +01:00
|
|
|
|
2018-12-10 08:05:16 +01:00
|
|
|
source tools/ci/activate-venv
|
2016-11-22 07:00:12 +01:00
|
|
|
|
2020-04-21 22:51:04 +02:00
|
|
|
if ! ./tools/build-release-tarball test; then
|
2016-07-13 03:12:03 +02:00
|
|
|
echo "Attempting to output failure logging data"
|
2016-12-01 19:47:40 +01:00
|
|
|
cat /tmp/tmp.*/update-prod-static.log || true
|
2016-07-13 03:12:03 +02:00
|
|
|
exit 1
|
|
|
|
fi
|
2015-10-15 01:47:42 +02:00
|
|
|
|
2020-07-16 21:17:48 +02:00
|
|
|
# Move all the required artifacts to /tmp/production-build
|
|
|
|
# that will be later sent down to downstream install jobs.
|
|
|
|
mkdir /tmp/production-build
|
|
|
|
mv /tmp/tmp.*/zulip-server-test.tar.gz /tmp/production-build
|
2020-06-27 01:12:44 +02:00
|
|
|
cp -a \
|
2020-10-15 04:55:57 +02:00
|
|
|
tools/ci/success-http-headers.template.txt \
|
|
|
|
tools/ci/production-install \
|
|
|
|
tools/ci/production-verify \
|
2021-06-07 09:12:58 +02:00
|
|
|
tools/ci/production-upgrade \
|
2021-11-19 02:04:30 +01:00
|
|
|
tools/ci/production-pgroonga \
|
2020-10-15 04:55:57 +02:00
|
|
|
tools/ci/production-upgrade-pg \
|
2022-12-01 05:51:52 +01:00
|
|
|
tools/ci/generate-failure-message \
|
2020-10-15 04:55:57 +02:00
|
|
|
package.json yarn.lock \
|
|
|
|
/tmp/production-build
|
2021-06-11 01:03:34 +02:00
|
|
|
|
2022-03-17 04:19:24 +01:00
|
|
|
# Check that webpack bundles use only ES2019 syntax.
|
2023-01-11 12:55:52 +01:00
|
|
|
# Use the yarn binary installed by tools/provision.
|
|
|
|
YARN="/srv/zulip-yarn/bin/yarn"
|
2021-06-11 01:03:34 +02:00
|
|
|
tar -C /tmp -xzf /tmp/production-build/zulip-server-test.tar.gz zulip-server-test/prod-static/serve/webpack-bundles
|
|
|
|
(
|
|
|
|
GLOBIGNORE=/tmp/zulip-server-test/prod-static/serve/webpack-bundles/katex-cli.js
|
2023-01-11 12:55:52 +01:00
|
|
|
$YARN run es-check es2019 /tmp/zulip-server-test/prod-static/serve/webpack-bundles/*.js
|
2021-06-11 01:03:34 +02:00
|
|
|
)
|