Discord supports webhooks to send messages in a specific text channel. I want to use it send a notification when the build fail or is fixed. In Jenkins I used a plugin to call the webhook and placed the plugin call in the post
field (the steps defined in post are always executed after all stages are done, even if one of them failed).
It looked like this:
post {
failure {
script {
gv = load "./.jenkins/script.groovy"
gv.notifyDiscord(FAILED_STAGE)
}
}
fixed {
script {
gv = load "./.jenkins/script.groovy"
gv.notifyDiscord(FAILED_STAGE)
}
}
}
Does Agola have something like post
? I tried to do a task that depended on my last task, but when the the first task fails, the last one is skipped and the discord notification task is never called. Also, how can I get the run status and if it was an error, how can I get which task failed?