diff --git a/library/jenkins.nix b/library/jenkins.nix index 510781b..1b38c6f 100644 --- a/library/jenkins.nix +++ b/library/jenkins.nix @@ -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 {