def _queue_build(repo, branch='master', tag='latest', created_by=None): task = Task(git_repo=repo, git_branch=branch, git_tag=tag, created_by=created_by) db.save_task(task) queues.enqueue_task(task)
def _build(repo, branch='master', tag=None, args=[]): if not repo: print('failed: are you in a git repo?') return task = Task(git_repo=repo, git_branch=branch, git_tag=tag, build_args=args, created_by=_get_username()) db.save_task(task) queues.enqueue_task(task) msg = 'ok - building: ' + repo if branch: msg += ' - ' + branch if tag: msg += ' - ' + tag print(msg)