【发布时间】:2017-02-09 09:00:59
【问题描述】:
刚开始使用 Jenkins,我似乎不知道如何为管道正确配置 SCM,因为那里没有 SCM 配置选项卡。我在我的 gitlab 项目中添加了一个 webhook,带有 URL
http://my-jenkins-server.com/git/notifyCommit?url=https://my-gitlab-server.com/my-repo.git
但是当我访问那个 URL 时,Jenkins 会告诉我
No Git consumers using SCM API plugin for: https://my-gitlab-server.com/my-repo.git
这是有道理的,因为我没有明确告诉 Jenkins 我的管道与这个 repo 相关联,只是隐含在 Jenkins 脚本中:
stage('Build'){
git url: 'https://my-gitlab-server.com/my-repo.git', branch: 'master', credentialsId: '<some-hash>'
sh 'cd linux-native; make clean all'
}
那么我如何告诉 Jenkins PIPELINE 与特定的 repo 相关联?或者,如何为我的管道找到正确的 notifyCommit url?
【问题讨论】: