Closed jeroen92 closed 7 months ago
Are you referring to build job pre-build-step? In pipeline builds you can always invoke the plugin with the necessary message.
In my pipeline jobs, I define a function at the start like so:
def notifyChat(String buildStatus = 'STARTED') {
// Build status of null means success.
buildStatus = buildStatus ?: 'SUCCESS'
def msg = "${buildStatus}: `${env.JOB_NAME}` #${env.BUILD_NUMBER}:\n${env.BUILD_URL}"
googlechatnotification (
url: "id:${params.GCHAT_CRED}",
message: "${msg}",
sameThreadNotification: true,
suppressInfoLoggers: true
)
}
And then can just call that function at multiple points during the build, like so:
stage('Build') {
steps {
notifyChat("BUILDING")
sh '''
for i in $(ls -1 *.md); do
./generate.sh $i
done
'''
}
}
Heya, little feature request.
Would it be possible for to post a Google Chat notification when starting a Jenkins job? It's quite handy to see whether a build pipeline is actually being triggered.
Thanks, Jeroen