upgrade-zulip: Archive release tarballs at /home/zulip/archives.

A common issue when doing a Zulip upgrade is trying to pass
upgrade-zulip a tarball path under /root, which doesn't work because
the Zulip user doesn't have permission to read the tarball.  We
could fix this by just unpacking the tarballs as root, but it seemed
like a nicer approach would be to archive the release tarballs
somewhere readable by the Zulip user (/home/zulip/archives) and unpack
them from there.

Fixes #208.
This commit is contained in:
Tim Abbott
2016-01-10 11:36:38 -08:00
parent c101bf663d
commit f871090bb6
3 changed files with 27 additions and 7 deletions

View File

@@ -1,5 +1,6 @@
#!/usr/bin/env python2.7
from __future__ import print_function
import errno
import os
import sys
import datetime
@@ -29,3 +30,13 @@ if __name__ == '__main__':
cmd = sys.argv[1]
if cmd == 'make_deploy_path':
print(make_deploy_path())
def mkdir_p(path):
# Python doesn't have an analog to `mkdir -p` < Python 3.2.
try:
os.makedirs(path)
except OSError, e:
if e.errno == errno.EEXIST and os.path.isdir(path):
pass
else:
raise