Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -163,6 +163,7 @@ Parameter:
| `buildKey` | String | yes | The unique key identifying the current build phase
| `buildName` | String | yes | The build phase's name shown on BitBucket
| `buildDescription` | String | yes | The build phase's description shown on BitBucket
| `buildUrl` | String | yes | The url linked to the phase in BitBucket. To link to a Jenkins artifact use `"${BUILD_URL}artifact/example.txt"`
| `repoSlug`| String | yes | The slug of the bitbucket repository to send the notification to
| `commitId` | String | yes | The id of the commit to attach the status notification to

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,12 @@ public class BitbucketBuildStatusNotifierStep extends AbstractStepImpl {
this.buildDescription = buildDescription;
}

private String buildUrl;
public String getBuildUrl() { return this.buildUrl; }
@DataBoundSetter public void setBuildUrl(String buildUrl) {
this.buildUrl = buildUrl;
}

private String buildState;
public String getBuildState() { return this.buildState; }

Expand Down Expand Up @@ -194,7 +200,10 @@ public Void run() throws Exception {
logger.info("Got commit id " + commitId);
logger.info("Got repo slug = " + repoSlug);

String buildUrl = BitbucketBuildStatusHelper.buildUrlFromBuild(build);
String buildUrl = step.getBuildUrl();
if (buildUrl == null) {
buildUrl = BitbucketBuildStatusHelper.buildUrlFromBuild(build);
}

BitbucketBuildStatus buildStatus = new BitbucketBuildStatus(buildState, buildKey, buildUrl, buildName,
buildDescription);
Expand Down