def deploy_demo(branch=None): """ Runs the demo task for the specified branch """ result_key = str(int(time.time())) # don't deploy these branches ignored_branches = ['dev', 'staging', 'production'] # hack to check to make sure a demo of that branch exists hook_key = 'github' ops.run_fabric_task('demo:amara show_demos', result_key=hook_key, notify=False) demos = ops.get_fabric_log(hook_key) demo_name = branch.replace('-', '_') if branch not in ignored_branches and demos.find(demo_name) != -1: task = 'demo:amara,{0} deploy'.format(branch) job = queue_task(ops.run_fabric_task, task, result_key)
def get_log(key=None): return _convert_ansi(ops.get_fabric_log(key))