来自詹金斯不同分支的Git Checkout



我正试图从不同的分支中提取支票

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的任何功能触发管道。有可能的办法吗?

如果你想在结账时填写BRANCH参数,你必须这样指定:

stage ("git-checkout"){
steps  {
checkout([$class: 'GitSCM',
branches: [[name: ${BRANCH}]],
doGenerateSubmoduleConfigurations: false,
extensions: [], submoduleCfg: [],
userRemoteConfigs: [[credentialsId: 'Gitlb_creds', url: 'https://gitlab.com']]])
}

最新更新