GITLAB_版本:GitLab企业版13.9.3-ee JENKINS_版本:2.263.4
我已经创建了一个jenkins管道,它是由gitlab中的变化触发的,但是它没有更新gitlab的状态。
pipeline {
agent any
stages {
stage('cloning from gitlab'){
steps{
git credentialsId: '7d13ef14-ee65-497b-8fba-7519f5012e81', url: 'git@git.MYDOMAIN.com:root/popoq.git'
}
}
stage('build') {
steps {
echo 'Notify GitLab'
updateGitlabCommitStatus name: 'Jenkins-build', state: 'pending'
echo 'build step goes here'
}
}
stage('echoing') {
steps{
echo "bla blaa bla"
}
}
stage(test) {
steps {
echo 'Notify GitLab'
echo 'test step goes here'
updateGitlabCommitStatus name: 'Jenkins-build', state: 'success'
}
}
}
}
在gitlab中没有显示任何管道,有什么建议吗?
2条答案
按热度按时间pokxtpni1#
我认为您在“option”块中遗漏了一个“gitlabBuilds”命令,该命令声明了您在构建中将要执行的步骤。
然后,您可以使用“updateGitlabCommitStatus”来引用这些步骤,但最好使用“gitlabCommitStatus”命令,如下所示:
zf9nrax12#
}