Reputation: 300
I have setup Jenkins for CI/CD. I am able to make successful build using git. After build is successful I upload the artifact to dropbox and once that is complete I want to send message to slack channel with the link from dropbox and also the commit messages.
I am able to send link to slack after some tweaking but I am unable to send git commits as message after the success to slack channel.
Anyone have any idea. I am using pipeline job for sending link to slack channel.
Upvotes: 0
Views: 1282
Reputation: 97
stage('Get commit details') {
steps {
script {
env.GIT_COMMIT_MSG = sh (script: 'git log -1 --pretty=%B ${GIT_COMMIT}', returnStdout: true).trim()
env.GIT_AUTHOR = sh (script: 'git log -1 --pretty=%cn ${GIT_COMMIT}', returnStdout: true).trim()
}
}
}
Upvotes: 1