Skip to content

Commit

Permalink
add autopull. It might even work
Browse files Browse the repository at this point in the history
  • Loading branch information
Undo1 committed Jan 17, 2015
1 parent 1554f43 commit 533618f
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion continuousintegration.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,16 @@ def watch_ci():
target_url = status["target_url"]
if state == "success":
if datetime.datetime.strptime(status["updated_at"], '%Y-%m-%dT%H:%M:%SZ') > datetime.datetime.now()-datetime.timedelta(seconds=10):
GlobalVars.charcoal_hq.send_message("[CI build passed](%s). Ready to pull!" % target_url)

r = requests.get('https://api.github.com/repos/Charcoal-SE/SmokeDetector/commits/' + latest_sha)
commit_message = r.json()["commit"]["message"]

if "autopull" in commit_message:
GlobalVars.charcoal_hq.send_message("[CI build passed](%s). Commit message contains 'autopull', pulling..." % target_url)
os._exit(3)
else:
GlobalVars.charcoal_hq.send_message("[CI build passed](%s). Ready to pull!" % target_url)

continue
elif state == "error" or state == "failure":
if datetime.datetime.strptime(status["updated_at"], '%Y-%m-%dT%H:%M:%SZ') > datetime.datetime.now()-datetime.timedelta(seconds=10):
Expand Down

0 comments on commit 533618f

Please sign in to comment.