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'
7
7
// https://jenkins.io/doc/book/pipeline/syntax/
8
8
pipeline {
9
9
agent any
10
+
11
+ environment {
12
+ GITLAB_URL = credentials(' gitlab_url' )
13
+ }
10
14
11
15
options {
12
16
buildDiscarder(logRotator(numToKeepStr : buildsToKeep, artifactNumToKeepStr : buildsToKeep))
17
+ gitLabConnection(" ${ env.GITLAB_URL} " )
13
18
}
14
19
15
20
triggers {
@@ -87,6 +92,11 @@ pipeline {
87
92
failure {
88
93
slackSend color : " danger" ,
89
94
message : " Failed: ${ currentBuild.fullDisplayName} \n ${ env.BUILD_URL} "
95
+ updateGitlabCommitStatus name : ' build' , state : ' failed'
96
+ }
97
+
98
+ success {
99
+ updateGitlabCommitStatus name : ' build' , state : ' success'
90
100
}
91
101
}
92
102
}
Original file line number Diff line number Diff line change @@ -5,9 +5,14 @@ String buildsToKeep = '500'
5
5
// https://jenkins.io/doc/book/pipeline/syntax/
6
6
pipeline {
7
7
agent { label 'windows' }
8
+
9
+ environment {
10
+ GITLAB_URL = credentials('gitlab_url')
11
+ }
8
12
9
13
options {
10
14
buildDiscarder(logRotator(numToKeepStr: buildsToKeep, artifactNumToKeepStr: buildsToKeep))
15
+ gitLabConnection("${env.GITLAB_URL}")
11
16
}
12
17
13
18
triggers {
@@ -46,6 +51,11 @@ pipeline {
46
51
failure {
47
52
slackSend color: "danger",
48
53
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'
49
59
}
50
60
}
51
61
}
You can’t perform that action at this time.
0 commit comments