我正试着从不同的分支机构拿钱,
stage ("git-checkout"){
steps {
checkout([$class: 'GitSCM',
branches: [[name: '**']],
doGenerateSubmoduleConfigurations: false,
extensions: [], submoduleCfg: [],
userRemoteConfigs: [[credentialsId: 'Gitlb_creds', url: 'https://gitlab.com']]])
}我在作业配置中传递了一个字符串参数作为分支,其中我在git lab repo中有多个分支,但即使在更改了值之后,它也只从一个分支进行签出。但我想根据我的选择分支触发管道,无论是从dev,master还是来自git lab repo的任何功能。有没有可能的方法?
发布于 2021-06-09 02:19:59
如果您希望在结帐期间填写BRANCH参数,则必须指定如下所示:
stage ("git-checkout"){
steps {
checkout([$class: 'GitSCM',
branches: [[name: ${BRANCH}]],
doGenerateSubmoduleConfigurations: false,
extensions: [], submoduleCfg: [],
userRemoteConfigs: [[credentialsId: 'Gitlb_creds', url: 'https://gitlab.com']]])
}https://stackoverflow.com/questions/67822577
复制相似问题