我的環境是下一個:詹金斯:gitlabCommitStatus不工作
-Jenkins 2.46.1
-Gitlab插件1.4.5
-GitLab社區版8.14.3
我配置了多分支管道。我曾嘗試過:
pipeline {
agent any
options {
gitLabConnection('MY_GITLAB')
gitlabCommitStatus(name: 'jenkins')
}
triggers {
gitlab(triggerOnPush: true, triggerOnMergeRequest: true, branchFilterType: 'All')
}
stages {
stage("build") {
steps {
gitlabCommitStatus(name: 'build') {
withMaven(
maven: 'maven3', // Maven installation declared in the Jenkins "Global Tool Configuration"
mavenSettingsConfig: 'MY_ID', // Maven settings.xml file defined with the Jenkins Config File Provider Plugin
mavenLocalRepo: '.repository') {
// Run the maven build
sh "mvn clean install"
}
}
}
}
stage("paralelo") {
steps {
parallel (
phase1: { sh "echo phase1" },
phase2: { sh "echo phase2" }
)
}
}
}
}
它工作沒有錯誤,但我沒有看到提交狀態在我的Gitlab。沒有來自gitlab的production.log中的錯誤。
謝謝大家!
您是否有多分支管道工作?因爲可能你正在尋找[this](https://github.com/jenkinsci/gitlab-plugin#git-configuration-for-multibranch-pipelineworkflow-jobs)配置 – Rik