Move update-prod-static etc. out of restart-server.

(imported from commit 763af1c8b1937cda860acc635d9d87c12d66a938)
This commit is contained in:
Tim Abbott 2013-04-09 15:18:54 -04:00
parent 9130f6722f
commit 88e2949818
2 changed files with 12 additions and 11 deletions

View File

@ -18,16 +18,6 @@ ENDC = '\033[0m'
os.chdir("/home/humbug/humbug")
#subprocess.check_call(["python", "manage.py", "syncdb"], stdout=open('/dev/null', 'w'))
# Delete all .pyc files to avoid old module files hanging around
logging.info("Starting restart process")
subprocess.check_call(["find", ".", "-name", "*.pyc", "-delete"], stdout=open('/dev/null', 'w'))
# Update static files
logging.info("Updating static files")
subprocess.check_call(["./tools/update-prod-static"])
# Restart the FastCGI process, which is running in a shell loop in screen.
# TODO: real daemonization
logging.info("Killing daemons")

View File

@ -4,9 +4,12 @@ import sys
import subprocess
import pylibmc
import traceback
import logging
from humbug_tools import check_output
logging.basicConfig(format="%(asctime)s update-deployment: %(message)s",
level=logging.INFO)
# Color codes
OKBLUE = '\033[94m'
OKGREEN = '\033[92m'
@ -23,6 +26,14 @@ if len(sys.argv) > 1:
subprocess.check_call(["git", "fetch"], stdout=open('/dev/null', 'w'))
subprocess.check_call(["git", "reset", "--hard", refname], stdout=open('/dev/null', 'w'))
# Delete all .pyc files to avoid old module files hanging around
subprocess.check_call(["find", ".", "-name", "*.pyc", "-delete"], stdout=open('/dev/null', 'w'))
# Update static files
logging.info("Updating static files")
subprocess.check_call(["./tools/update-prod-static"])
logging.info("Restarting server...")
subprocess.check_call(["./tools/restart-server"])
if newrev == '0000000000000000000000000000000000000000':