Commit Graph

14 Commits

Author SHA1 Message Date
Gaurav Pandey faae845366 upgrade: Modify upgrade scripts to handle failure.
The current `upgrade-zulip` and `upgrade-zulip-from-git`
bash scripts exit with a zero status even if the
upgrade commands exit with a non-zero status.
Hence add `set -e` command which exits the script with
the same status as the non-zero command.

For pipe commands however, the net status of a command
is the status of the last command, hence if the other parts
fail, the net status is only determined by the last command.
This is the case with our main /lib/upgrade-zulip* command
in the scripts whose status is determined by the `tee` command
instead. Hence add a small condition to get the status of the
actual upgrade command and exit the script if it fails with
a non-zero command.

We also check whether the script is being run as root, matching the
install script logic.
2021-06-23 08:42:20 -07:00
Anders Kaseorg 392175d6e8 Use #!/usr/bin/env for bash shebangs.
/bin/sh and /usr/bin/env are the only two binaries that NixOS provides
at a fixed path (outside a buildFHSUserEnv sandbox).

This discussion was split from #11004.

Signed-off-by: Anders Kaseorg <andersk@mit.edu>
2018-12-17 17:21:08 -08:00
Anders Kaseorg 0d12dfd06f Improve shell quoting hygiene
Most of these problems were found by ShellCheck
(http://www.shellcheck.net).

Signed-off-by: Anders Kaseorg <andersk@mit.edu>
2015-09-25 23:25:08 -04:00
Zev Benjamin 87a6838e0e enterprise: Log the output of upgrade-zulip and install scripts
We may eventually want to rotate the log files, but this seems good
enough for now.

(imported from commit 9a54fa6b40bc62f68e52ef552c1a676856b21829)
2013-11-14 08:08:59 -05:00
Zev Benjamin 9addde74ec enterprise: Split upgrade-zulip in two for better future-proofing
(imported from commit 808d8d68a6e799aa2962eec90c0953db3c94cfa4)
2013-11-13 16:57:00 -05:00
Zev Benjamin e8c104012b Move su_to_zulip into zulip_tools.py
(imported from commit 4a79f87dc396da9419a0a1cf5f5b7bb798d5b194)
2013-11-13 16:56:59 -05:00
Zev Benjamin 0b592a27b1 enterprise: Make upgrade-zulip do puppet applies and schema migrations
(imported from commit 6d0109e6cd6a02ed5d57b0c0b4c9dc052f158344)
2013-11-13 16:26:04 -05:00
Zev Benjamin baecc950a5 enterprise: Remove dead code
(imported from commit ca0cdc89f72367d15cd8cfe33666a4cff80deb66)
2013-11-13 16:26:03 -05:00
Tim Abbott 5c450afd2d Split out unpack-zulip from the upgrade script.
(imported from commit e41a8ad01c3042c7d877fb3aa17f9617dc2b0121)
2013-11-12 09:22:48 -05:00
Kevin Mehall 78b45b61fb Minify JS in the localserver upgrade tarball.
This moves the list of removed files from .gitattributes to
tools/build-local-server-tarball because static/ and tools/ are
necessary for update-prod-static, and it seemed best to keep the
entire list in one place.

(imported from commit 2a447cbde29e90d776da43bb333650a40d4d363c)
2013-11-04 13:40:43 -05:00
Tim Abbott ca0848b308 Don't purge old deployments on local server, for now.
(imported from commit 860e51691d90eee3e594388d514af07c9bb86d6a)
2013-11-04 13:22:42 -05:00
Tim Abbott 5f92ccb422 [manual] Move update-prod-static and update-deployments back to tools/.
update-deployment has been replaced by upgrade-zulip for local server
instances, since it won't be running off a git repository, and
update-prod-static won't be needed since we plan on shipping minified
javascript.

When we deploy this, the deployment will fail, and then we'll need to
update the git checkout from which post-receive runs on git.zulip.net.

(imported from commit 86aaedbab09c60ae86ac1d0ae492d0d1bc45569f)
2013-11-04 13:22:41 -05:00
Tim Abbott adc5771062 Rename purge-deployments to purge-old-deployments.
Since this is a user-facing script, we should make it more clear about
what it does.

(imported from commit eecaed8462a92fe7c688df5c32fea2e088b25058)
2013-11-04 13:22:41 -05:00
Tim Abbott 81aff30127 Add script to upgrade a local server installation.
This has a decent amount of code copied from update-deployment, but
there's enough different that I think it's reasonable to write this
and then move some common code into the zulip_tools library.

(imported from commit ae4fdf8125daf802f04f4543a9f1ebae4e9cd3bd)
2013-11-04 13:22:41 -05:00