예제 #1
0
def create_new_branch_job_triggers(branch_id):
    branch = Branch.objects.get(id = branch_id)
    for branchjob in branch.repository.repositorynewbranchjob_set.all():
        if branchjob.prefix and branch.github_name.startswith(branchjob.prefix):
            trigger = BranchJobTrigger(
                branch = branch,
                job = branchjob.job,
            )
            trigger.save()
예제 #2
0
def create_new_branch_job_triggers(branch_id):
    branch = Branch.objects.get(id=branch_id)
    for branchjob in branch.repository.repositorynewbranchjob_set.all():
        if branchjob.prefix and branch.github_name.startswith(
                branchjob.prefix):
            trigger = BranchJobTrigger(
                branch=branch,
                job=branchjob.job,
            )
            trigger.save()
예제 #3
0
def create_new_branch_job_triggers(sender, **kwargs):
    if not kwargs['created']:
        # Only run on create
        return

    branch = kwargs['instance']
    for branchjob in branch.repository.repositorynewbranchjob_set.all():
        if branchjob.prefix and branch.github_name.startswith(branchjob.prefix):
            trigger = BranchJobTrigger(
                branch = branch,
                job = branchjob.job,
            )
            trigger.save()