File tree Expand file tree Collapse file tree 2 files changed +20
-0
lines changed
Expand file tree Collapse file tree 2 files changed +20
-0
lines changed Original file line number Diff line number Diff line change @@ -7,9 +7,14 @@ String buildsToKeep = '500'
77// https://jenkins.io/doc/book/pipeline/syntax/
88pipeline {
99 agent any
10+
11+ environment {
12+ GITLAB_URL = credentials(' gitlab_url' )
13+ }
1014
1115 options {
1216 buildDiscarder(logRotator(numToKeepStr : buildsToKeep, artifactNumToKeepStr : buildsToKeep))
17+ gitLabConnection(" ${ env.GITLAB_URL} " )
1318 }
1419
1520 triggers {
@@ -87,6 +92,11 @@ pipeline {
8792 failure {
8893 slackSend color : " danger" ,
8994 message : " Failed: ${ currentBuild.fullDisplayName} \n ${ env.BUILD_URL} "
95+ updateGitlabCommitStatus name : ' build' , state : ' failed'
96+ }
97+
98+ success {
99+ updateGitlabCommitStatus name : ' build' , state : ' success'
90100 }
91101 }
92102}
Original file line number Diff line number Diff line change @@ -5,9 +5,14 @@ String buildsToKeep = '500'
55// https://jenkins.io/doc/book/pipeline/syntax/
66pipeline {
77 agent { label 'windows' }
8+
9+ environment {
10+ GITLAB_URL = credentials('gitlab_url')
11+ }
812
913 options {
1014 buildDiscarder(logRotator(numToKeepStr: buildsToKeep, artifactNumToKeepStr: buildsToKeep))
15+ gitLabConnection("${env.GITLAB_URL}")
1116 }
1217
1318 triggers {
@@ -46,6 +51,11 @@ pipeline {
4651 failure {
4752 slackSend color: "danger",
4853 message: "Failed: ${currentBuild.fullDisplayName}\n${env.BUILD_URL}"
54+ updateGitlabCommitStatus name: 'build-windows', state: 'failed'
55+ }
56+
57+ success {
58+ updateGitlabCommitStatus name: 'build-windows', state: 'success'
4959 }
5060 }
5161}
You can’t perform that action at this time.
0 commit comments