Skip to content
This repository has been archived by the owner on Feb 29, 2024. It is now read-only.

Bug Fixed: Slack notifications delivered for every fail, not only master and devel #12

Closed
wants to merge 1 commit into from
Closed
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
7 changes: 4 additions & 3 deletions Jenkinsfile
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

name = 'sovrin-client-rust'
def err
def publishBranch = (env.BRANCH_NAME == 'master' || env.BRANCH_NAME == 'devel')

try {

Expand All @@ -20,7 +21,7 @@ try {
}
}

if (env.BRANCH_NAME != 'master' && env.BRANCH_NAME != 'devel') {
if (!publishBranch) {
echo "${env.BRANCH_NAME}: skip publishing"
return
}
Expand All @@ -35,15 +36,15 @@ try {
} catch(e) {
currentBuild.result = "FAILED"
node('ubuntu-master') {
sendNotification.fail()
sendNotification.fail([slack: publishBranch])
}
err = e
} finally {
if (err) {
throw err
}
currentBuild.result = "SUCCESS"
if (env.BRANCH_NAME == 'master' || env.BRANCH_NAME == 'devel') {
if (publishBranch) {
node('ubuntu-master') {
sendNotification.success(name)
}
Expand Down