mirror of https://github.com/zulip/zulip.git
install, provision: Treat all nonzero exit codes as failure, not just 1.
Signed-off-by: Anders Kaseorg <anders@zulipchat.com>
This commit is contained in:
parent
89df6e9425
commit
1d05a71b5d
|
@ -8,7 +8,7 @@ PAPER =
|
||||||
BUILDDIR = _build
|
BUILDDIR = _build
|
||||||
|
|
||||||
# User-friendly check for sphinx-build
|
# User-friendly check for sphinx-build
|
||||||
ifeq ($(shell which $(SPHINXBUILD) >/dev/null 2>&1; echo $$?), 1)
|
ifneq ($(shell which $(SPHINXBUILD) >/dev/null 2>&1; echo $$?), 0)
|
||||||
$(error The '$(SPHINXBUILD)' command was not found. Make sure you have Sphinx installed, then set the SPHINXBUILD environment variable to point to the full path of the '$(SPHINXBUILD)' executable. Alternatively you can add the directory with the executable to your PATH. If you don't have Sphinx installed, grab it from http://sphinx-doc.org/)
|
$(error The '$(SPHINXBUILD)' command was not found. Make sure you have Sphinx installed, then set the SPHINXBUILD environment variable to point to the full path of the '$(SPHINXBUILD)' executable. Alternatively you can add the directory with the executable to your PATH. If you don't have Sphinx installed, grab it from http://sphinx-doc.org/)
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
|
|
@ -15,13 +15,13 @@ mkdir -p /var/log/zulip
|
||||||
"$(dirname "$(dirname "$0")")/lib/install" "$@" 2>&1 | tee -a /var/log/zulip/install.log
|
"$(dirname "$(dirname "$0")")/lib/install" "$@" 2>&1 | tee -a /var/log/zulip/install.log
|
||||||
failed=${PIPESTATUS[0]}
|
failed=${PIPESTATUS[0]}
|
||||||
|
|
||||||
if [ "$failed" = 1 ]; then
|
if [ "$failed" -ne 0 ]; then
|
||||||
echo -e '\033[0;31m'
|
echo -e '\033[0;31m'
|
||||||
echo "Zulip installation failed!"
|
echo "Zulip installation failed (exit code $failed)!"
|
||||||
echo
|
echo
|
||||||
echo -n "The install process is designed to be idempotent, so you can retry "
|
echo -n "The install process is designed to be idempotent, so you can retry "
|
||||||
echo -n "after resolving whatever issue caused the failure (there should be a traceback above). "
|
echo -n "after resolving whatever issue caused the failure (there should be a traceback above). "
|
||||||
echo -n "A log of this installation is available in /var/log/zulip/install.log"
|
echo -n "A log of this installation is available in /var/log/zulip/install.log"
|
||||||
echo -e '\033[0m'
|
echo -e '\033[0m'
|
||||||
exit 1
|
exit "$failed"
|
||||||
fi
|
fi
|
||||||
|
|
|
@ -6,7 +6,13 @@ 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.
|
||||||
if ! tools/provision; then
|
tools/provision || {
|
||||||
echo "\`provision\`: Something went wrong with the provisioning, might be a network issue, Retrying to provision..."
|
ret=$?
|
||||||
tools/provision
|
if [ "$ret" = 1 ]; then
|
||||||
fi
|
echo "\`provision\`: Something went wrong with the provisioning, might be a network issue, Retrying to provision..."
|
||||||
|
tools/provision
|
||||||
|
else
|
||||||
|
echo "\`provision\`: Something REALLY BAD went wrong with the provisioning, not retrying."
|
||||||
|
exit "$ret"
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
|
@ -29,10 +29,16 @@ sudo rm -f /etc/apt/sources.list.d/mongodb*.list
|
||||||
# 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.
|
||||||
if ! tools/provision --production-travis; then
|
tools/provision --production-travis || {
|
||||||
echo "\`provision\`: Something went wrong with the provisioning, might be a network issue, Retrying to provision..."
|
ret=$?
|
||||||
tools/provision --production-travis
|
if [ "$ret" = 1 ]; then
|
||||||
fi
|
echo "\`provision\`: Something went wrong with the provisioning, might be a network issue, Retrying to provision..."
|
||||||
|
tools/provision --production-travis
|
||||||
|
else
|
||||||
|
echo "\`provision\`: Something REALLY BAD went wrong with the provisioning, not retrying."
|
||||||
|
exit "$ret"
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
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
|
||||||
|
|
|
@ -28,16 +28,16 @@ export PYTHONUNBUFFERED=1
|
||||||
./lib/provision.py "$@" 2>&1 | tee -a "$LOG_PATH"
|
./lib/provision.py "$@" 2>&1 | tee -a "$LOG_PATH"
|
||||||
failed=${PIPESTATUS[0]}
|
failed=${PIPESTATUS[0]}
|
||||||
|
|
||||||
if [ "$failed" = 1 ]; then
|
if [ "$failed" -ne 0 ]; then
|
||||||
echo -e "$FAIL"
|
echo -e "$FAIL"
|
||||||
echo "Provisioning failed!"
|
echo "Provisioning failed (exit code $failed)!"
|
||||||
echo
|
echo
|
||||||
echo "* Look at the traceback(s) above to find more about the errors."
|
echo "* Look at the traceback(s) above to find more about the errors."
|
||||||
echo "* Resolve the errors or get help on chat."
|
echo "* Resolve the errors or get help on chat."
|
||||||
echo "* If you can fix this yourself, you can re-run tools/provision at any time."
|
echo "* If you can fix this yourself, you can re-run tools/provision at any time."
|
||||||
echo "* Logs are here: zulip/var/log/provision.log"
|
echo "* Logs are here: zulip/var/log/provision.log"
|
||||||
echo -e "$ENDC"
|
echo -e "$ENDC"
|
||||||
exit 1
|
exit "$failed"
|
||||||
elif [ "$VIRTUAL_ENV" != "/srv/zulip-py3-venv" ] && [ -z "${TRAVIS}${SKIP_VENV_SHELL_WARNING}" ]; then
|
elif [ "$VIRTUAL_ENV" != "/srv/zulip-py3-venv" ] && [ -z "${TRAVIS}${SKIP_VENV_SHELL_WARNING}" ]; then
|
||||||
echo -e "$WARNING"
|
echo -e "$WARNING"
|
||||||
echo "WARNING: This shell does not have the Zulip Python 3 virtualenv activated."
|
echo "WARNING: This shell does not have the Zulip Python 3 virtualenv activated."
|
||||||
|
|
Loading…
Reference in New Issue