update-deployment: Move color codes to humbug_tools.py.

(imported from commit 96a79a699ea032714b24aa6572fd188433b979a8)
This commit is contained in:
Tim Abbott 2013-06-04 18:21:47 -04:00
parent 5a1f036db3
commit 795173ac86
3 changed files with 9 additions and 14 deletions

View File

@ -19,3 +19,10 @@ def check_output(*popenargs, **kwargs):
DEPLOYMENTS_DIR = "/home/humbug/humbug-deployments"
LOCK_DIR = os.path.join(DEPLOYMENTS_DIR, "lock")
TIMESTAMP_FORMAT = '%Y-%m-%d-%H-%M-%S'
# Color codes
OKBLUE = '\033[94m'
OKGREEN = '\033[92m'
WARNING = '\033[93m'
FAIL = '\033[91m'
ENDC = '\033[0m'

View File

@ -6,15 +6,10 @@ import pylibmc
import traceback
import logging
import time
from humbug_tools import ENDC, WARNING, OKGREEN
logging.basicConfig(format="%(asctime)s restart-server: %(message)s",
level=logging.INFO)
# Color codes
OKBLUE = '\033[94m'
OKGREEN = '\033[92m'
WARNING = '\033[93m'
FAIL = '\033[91m'
ENDC = '\033[0m'
os.chdir("/home/humbug/humbug-deployments/current")

View File

@ -5,20 +5,13 @@ import subprocess
import pylibmc
import traceback
import logging
from humbug_tools import check_output, DEPLOYMENTS_DIR, LOCK_DIR, TIMESTAMP_FORMAT
from humbug_tools import check_output, DEPLOYMENTS_DIR, LOCK_DIR, TIMESTAMP_FORMAT, FAIL, ENDC
import datetime
import shutil
logging.basicConfig(format="%(asctime)s update-deployment: %(message)s",
level=logging.INFO)
# Color codes
OKBLUE = '\033[94m'
OKGREEN = '\033[92m'
WARNING = '\033[93m'
FAIL = '\033[91m'
ENDC = '\033[0m'
if len(sys.argv) > 1:
oldrev = sys.argv[1]
newrev = sys.argv[2]