Created
August 21, 2017 10:49
-
-
Save ntakouris/0f0c1a8c22e0dc0fbfe927bfd18c3253 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
node { | |
try{ | |
notifyBuild('STARTED') | |
bitbucketStatusNotify(buildState: 'INPROGRESS') | |
//..work work.. | |
}catch (e) { | |
// If there was an exception thrown, the build failed | |
currentBuild.result = "FAILED" | |
bitbucketStatusNotify(buildState: 'FAILED') | |
throw e | |
} finally { | |
// Success or failure, always send notifications | |
notifyBuild(currentBuild.result) | |
def bs = currentBuild.result ?: 'SUCCESSFUL' | |
if(bs == 'SUCCESSFUL'){ | |
bitbucketStatusNotify(buildState: 'SUCCESSFUL') | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment