阅读此readme
在Jenkins中安装了GitLab插件
下面的脚本能够读取正确的存储库名称,但错误的分支名称
document.querySelectorAll('a.some_class').forEach(link => {
link.href = link.href.replace(/\/text\//, '/sometext1/');
});
以下是GitLab上的设置:
我在GitLab存储库中有多个分支的Webhook。
在网络挂钩上,为什么node('worker_node'){
stage('stage1'){
def repoName = env.gitlabSourceRepoName
println "Repository Name: " + repoName
def repoUrl = env.gitlabSourceRepoURL
println "Repository url: " + repoUrl
def repoSshUrl = env.gitlabSourceRepoSshUrl
println "Repository ssh url: " + repoSshUrl
def repoHttpUrl = env.gitlabSourceRepoHttpUrl
println "Repository http url: " + repoHttpUrl
def branchName = env.gitlabSourceBranch
println "Branch name: " + branchName
}
}
总是给branchName
?
答案 0 :(得分:0)
根据https://github.com/jenkinsci/gitlab-plugin#webhook-url中的文档,您应该使用:
“对于单一存储库工作流:origin / $ {gitlabSourceBranch}”
“对于分叉的存储库工作流:merge-requests / $ {gitlabMergeRequestIid}”