Gradle plugin for interacting with Bitbucket's REST API.
buildscript() {
repositories {
jcenter()
}
dependencies {
classpath group: 'com.github', name: 'gradle-bitbucket-rest-plugin', version: '0.0.1', changing: true
}
}
apply plugin: 'gradle-bitbucket-rest-plugin'
New tasks or features are generally added as needed and/or requested. If there is something you want to see just open an ISSUE and ask or send in a PullRequest. Generally speaking tasks here have a 1-to-1 mapping to endpoints in the bitbucket-rest java client. The philosophy is that this plugin should be generic in nature acting and act as building blocks for you to potentially build more complicated and specific plugins should you need to do so.
groovydocs can be found via github pages here
The bitbucketRest
extension is provided to define the url
and credentials
for connecting to an Bitbucket instance.
Using the extension, and subsequently exposing this potentially private information, is required only if one does NOT want to use the various means of setting the aforementioned properties noted in the Credentials
section below.
bitbucketRest {
url { "http://127.0.0.1:7990" } // Optional and defaults to http://127.0.0.1:7990
credentials { "admin:password" } // Optional and defaults to null
}
Because this plugin builds on top of bitbucket-rest library one can supply
the url and credentials in any form this library accepts. Furthermore,
bitbucket-rest allows the url
and credentials
to be optionally supplied through properties or environment variables. This gives great flexibility in the way the user
wants to define and/or hide their url or credentials assuming one does not want to use the bitbucketRest
extension.
Name | Description |
---|---|
DeleteBranch | Delete a branch |
Name | Description |
---|---|
GetPullRequest | Get a PullRequest |
The functional tests provide many examples that you can use in your own code.
- bitbucket-rest - java library used to interact with bitbucket program
Running functional tests against an existing bitbucket program can be done like so:
./gradlew functionalTest -PbitbucketUrl=http://127.0.0.1:7990 -PbitbucketCredentials=root:root
If you're looking for a new feature, or are interested in contributing, we'd love to review your PR. If you don't have a new feature in mind, and are more interested in just hacking on the project, feel free to reach out for suggestions.