使用Jenkins Workflow插件,我可以根据分支检出存储库.但是,我想基于标签检出存储库.
这是我当前检查主分支的配置
node { git url: src, branch: 'master' }
现在我想实现检查标签3.6.1.我试图将分支更改为标记,但这不起作用.文档中没有关于签出标签的内容.
这目前可能吗?我在监督什么吗?
引用;
https://github.com/jenkinsci/workflow-plugin
https://github.com/jenkinsci/workflow-plugin/blob/master/scm-step/README.md
https://github.com/jenkinsci/workflow-plugin/blob/master/scm-step/src/main/resources/org/jenkinsci/plugins/workflow/steps/scm/GitStep/config.jelly
https://github.com/jenkinsci/workflow-plugin/blob/master/scm-step/src/main/java/org/jenkinsci/plugins/workflow/steps/scm/GitStep.java
通过浏览问题列表,我自己找到了答案.似乎他们不会改变它; https://issues.jenkins-ci.org/browse/JENKINS-27018
这是建议的解决方案;
checkout scm: [$class: 'GitSCM', userRemoteConfigs: [[url: src]], branches: [[name: 'refs/tags/3.6.1']]], poll: false
这有效:
checkout scm: [$class: 'GitSCM', userRemoteConfigs: [[url: repoURL, credentialsId: credential]], branches: [[name: tag-version]]],poll: false
不是这个:
checkout scm: [$class: 'GitSCM', userRemoteConfigs: [[url: repoURL], [credentialsId: credential]], branches: [[name: tag-version]]],poll: false