Skip to content

Commit

Permalink
[JENKINS-31788] Added support for Bitbucket Plugin
Browse files Browse the repository at this point in the history
  • Loading branch information
v1v committed Nov 28, 2015
1 parent 1b5e781 commit 5436f27
Show file tree
Hide file tree
Showing 3 changed files with 30 additions and 0 deletions.
@@ -0,0 +1,5 @@
job('example-1') {
triggers {
bitbucketPush()
}
}
Expand Up @@ -315,4 +315,16 @@ class TriggerContext extends AbstractExtensibleContext {
}
}
}

/**
* Trigger that runs jobs on push notifications from BitBucket.
*
* @since 1.41
*/
@RequiresPlugin(id = 'bitbucket')
void bitbucketPush() {
triggerNodes << new NodeBuilder().'com.cloudbees.jenkins.plugins.BitBucketTrigger' {
spec ''
}
}
}
Expand Up @@ -786,4 +786,17 @@ class TriggerContextSpec extends Specification {
then:
thrown(DslScriptException)
}

def 'call bitbucket trigger'() {
when:
context.bitbucketPush()

then:
context.triggerNodes.size() == 1
with(context.triggerNodes[0]) {
name() == 'com.cloudbees.jenkins.plugins.BitBucketTrigger'
spec[0].value() == ''
}
1 * mockJobManagement.requirePlugin('bitbucket')
}
}

0 comments on commit 5436f27

Please sign in to comment.