Skip to content

Commit

Permalink
Update README to include buildState and buildName
Browse files Browse the repository at this point in the history
  • Loading branch information
Arne Westphal committed Aug 8, 2019
1 parent 57b7c93 commit 522222f
Showing 1 changed file with 18 additions and 3 deletions.
21 changes: 18 additions & 3 deletions readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,22 @@ node {
}
```

Or you could as well use

```groovy
checkout scm
notifyBitbucket(buildState: 'INPROGRESS') // Notifies the Bitbucket instance of an INPROGRESS build
try {
// Do stuff
notifyBitbucket(buildState: 'SUCCESSFUL') // Notifies the Bitbucket instance of an SUCCESSFUL build
} catch(err) {
// Do clean up
notifyBitbucket(buildState: 'FAILED') // Notifies the Bitbucket instance of an FAILED build
}
```

In situations where an advanced setup is required the following can be used:

```groovy
Expand All @@ -98,15 +114,14 @@ node {
}
def notifyBitbucket(String state) {
if ('SUCCESS' == state || 'FAILED' == state) {
currentBuild.result = state // Set result of currentBuild !Important!
}
notifyBitbucket(
commitSha1: 'commit',
credentialsId: '00000000-1111-2222-3333-123456789abc',
disableInprogressNotification: false,
considerUnstableAsSuccess: true,
ignoreUnverifiedSSLPeer: true,
buildState: state,
buildName: 'Performance Testing',
includeBuildNumberInKey: false,
prependParentProjectKey: false,
projectKey: '',
Expand Down

0 comments on commit 522222f

Please sign in to comment.