scripts/upgrade-zulip-from-git: Don't cache the repo URL, only the contents

We document the `deployment.git_repo_url` setting in `/etc/zulip/zulip.conf`
to control where this script fetches from, and don't say that it's
only read on the first such upgrade and cached thereafter.  The documented
behavior seems like the right behavior.  So use the currently configured
URL every time, by writing it anew into the config of our cache repo.
This commit is contained in:
Greg Price 2017-06-21 18:47:25 -07:00
parent 8851f1c5dd
commit e1ce3daaff
1 changed files with 1 additions and 1 deletions

View File

@ -46,7 +46,6 @@ get_deployment_lock(error_rerun_script)
try: try:
deploy_path = make_deploy_path() deploy_path = make_deploy_path()
if not os.path.exists(LOCAL_GIT_CACHE_DIR): if not os.path.exists(LOCAL_GIT_CACHE_DIR):
os.chdir('/srv/')
logging.info("Cloning the repository") logging.info("Cloning the repository")
subprocess.check_call(["git", "clone", "-q", git_url, "--mirror", LOCAL_GIT_CACHE_DIR], subprocess.check_call(["git", "clone", "-q", git_url, "--mirror", LOCAL_GIT_CACHE_DIR],
stdout=open('/dev/null', 'w')) stdout=open('/dev/null', 'w'))
@ -54,6 +53,7 @@ try:
logging.info("Fetching the latest commits") logging.info("Fetching the latest commits")
os.chdir(LOCAL_GIT_CACHE_DIR) os.chdir(LOCAL_GIT_CACHE_DIR)
subprocess.check_call(["git", "remote", "set-url", "origin", git_url], preexec_fn=su_to_zulip)
subprocess.check_call(["git", "fetch", "-q"], preexec_fn=su_to_zulip) subprocess.check_call(["git", "fetch", "-q"], preexec_fn=su_to_zulip)
subprocess.check_call(["git", "clone", "-q", "-b", refname, LOCAL_GIT_CACHE_DIR, deploy_path], subprocess.check_call(["git", "clone", "-q", "-b", refname, LOCAL_GIT_CACHE_DIR, deploy_path],