Skip to content
Browse files

Send log name to pushbot.

  • Loading branch information...
1 parent f961496 commit 91ef46ea8b4b2b38f76502bd63cbdcb02a8ac142 @oremj oremj committed
Showing with 7 additions and 5 deletions.
  1. +7 −5 chief.py
View
12 chief.py
@@ -24,13 +24,17 @@ def do_update(app_name, app_settings, webapp_ref, who):
if not os.path.isdir(log_dir):
os.mkdir(log_dir)
+ log_name = "%s.%s" % (re.sub('[^A-z0-9_-]', '.', webapp_ref), timestamp)
+ log_file = os.path.join(log_dir, log_name)
+
def run(task, output):
subprocess.check_call(['commander', deploy, task],
stdout=output, stderr=output)
def pub(event):
redis = redislib.Redis(**settings.REDIS_BACKENDS['master'])
- d = {'event': event, 'ref': webapp_ref, 'who': who}
+ d = {'event': event, 'ref': webapp_ref, 'who': who,
+ 'logname': log_name}
redis.publish(app_settings['pubsub_channel'], json.dumps(d))
def history(status):
@@ -41,13 +45,11 @@ def history(status):
redis.hmset(key, d)
try:
+ output = open(log_file, 'a')
+
pub('BEGIN')
yield 'Updating! revision: %s\n' % webapp_ref
- log_name = "%s.%s" % (re.sub('[^A-z0-9_-]', '.', webapp_ref), timestamp)
- log_file = os.path.join(log_dir, log_name)
- output = open(log_file, 'a')
-
run('pre_update:%s' % webapp_ref, output)
pub('PUSH')
yield 'We have the new code!\n'

0 comments on commit 91ef46e

Please sign in to comment.
Something went wrong with that request. Please try again.