jenkins: add mattermost notifications

This commit is contained in:
Ingolf Wagner 2020-03-10 00:49:37 +08:00
parent 89e8c1dc67
commit d065e151b6
No known key found for this signature in database
GPG key ID: 76BF5F1928B9618B

View file

@ -2,6 +2,8 @@
with builtins;
# https://jenkinsci.github.io/job-dsl-plugin/
{
# source container url and credentialsId
job = name:
@ -50,6 +52,14 @@ with builtins;
in ''
pipeline {
agent any
post {
failure {
mattermostSend channel: 'notification', color: '#FF0000', message: "Failed to build : [''${env.JOB_NAME}-''${env.BUILD_NUMBER}](''${env.BUILD_URL})"
}
success {
mattermostSend channel: 'jenkins', color: '#00FF00', message: "Successfully build : [''${env.JOB_NAME}-''${env.BUILD_NUMBER}](''${env.JOB_URL})"
}
}
stages{
stage('Pull') {
steps {
@ -89,6 +99,14 @@ with builtins;
dsl = ''
pipeline {
agent any
post {
failure {
mattermostSend channel: 'notification', color: '#FF0000', message: "Failed to build : [''${env.JOB_NAME}-''${env.BUILD_NUMBER}](''${env.BUILD_URL})"
}
success {
mattermostSend channel: 'jenkins', color: '#00FF00', message: "Successfully build : [''${env.JOB_NAME}-''${env.BUILD_NUMBER}](''${env.JOB_URL})"
}
}
stages{
stage('Pull') {
steps {