jenkins: add mattermost notifications
This commit is contained in:
parent
89e8c1dc67
commit
d065e151b6
1 changed files with 18 additions and 0 deletions
|
@ -2,6 +2,8 @@
|
||||||
|
|
||||||
with builtins;
|
with builtins;
|
||||||
|
|
||||||
|
# https://jenkinsci.github.io/job-dsl-plugin/
|
||||||
|
|
||||||
{
|
{
|
||||||
# source container url and credentialsId
|
# source container url and credentialsId
|
||||||
job = name:
|
job = name:
|
||||||
|
@ -50,6 +52,14 @@ with builtins;
|
||||||
in ''
|
in ''
|
||||||
pipeline {
|
pipeline {
|
||||||
agent any
|
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{
|
stages{
|
||||||
stage('Pull') {
|
stage('Pull') {
|
||||||
steps {
|
steps {
|
||||||
|
@ -89,6 +99,14 @@ with builtins;
|
||||||
dsl = ''
|
dsl = ''
|
||||||
pipeline {
|
pipeline {
|
||||||
agent any
|
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{
|
stages{
|
||||||
stage('Pull') {
|
stage('Pull') {
|
||||||
steps {
|
steps {
|
||||||
|
|
Loading…
Reference in a new issue