update-deployment: Purge old deployments after deploy

(imported from commit 9a320617e22a1d71506fbb76443a00c178ae5367)
This commit is contained in:
Zev Benjamin
2013-05-15 17:58:05 -04:00
committed by Tim Abbott
parent 30d417a692
commit 4bfda4c49e

View File

@@ -55,6 +55,8 @@ subprocess.check_call(["ln", '-nsf', deploy_path, os.path.join(DEPLOYMENTS_DIR,
logging.info("Restarting server...")
subprocess.check_call([os.path.join(DEPLOYMENTS_DIR, "current/tools/restart-server")])
logging.info("Deployment complete")
shutil.rmtree(LOCK_DIR)
if newrev == '0000000000000000000000000000000000000000':
# 0000000000000000000000000000000000000000 means we're deleting the ref
@@ -67,4 +69,4 @@ if '[schema]' in commits:
print FAIL + "Schema change detected! Please make the appropriate changes manually." + ENDC
print
shutil.rmtree(LOCK_DIR)
subprocess.check_call(["./tools/purge-deployments"])