滁州网站建设推广,如何快速网站备案,惠州网站制作公司哪家好,网络营销有哪些功能关于jenkins git parameter使用gitlab标签发布和分支发布的用法
手动配置的我就不说了#xff0c;点点点就行#xff0c;主要是说一下在pipeline里如何使用
通过分支拉取gitlab仓库代码
pipeline {agent anyenvironment {}parameters {gitParameter(branch: , branchFilte…关于jenkins git parameter使用gitlab标签发布和分支发布的用法
手动配置的我就不说了点点点就行主要是说一下在pipeline里如何使用
通过分支拉取gitlab仓库代码
pipeline {agent anyenvironment {}parameters {gitParameter(branch: , branchFilter: .*, defaultValue: , description: Branch for build and deploy, name: branch, quickFilterEnabled: false, selectedValue: NONE, sortMode: NONE, tagFilter: *, type: PT_BRANCH)}stages {stage(pull code) {steps {checkout([$class: GitSCM, branches: [[name: ${branch}]], extensions: [], userRemoteConfigs: [[credentialsId: gitlab_auth, url: git10.1.60.114:gitlab-instance-c484dcfc/nodejs.git]]])}}}
}
在pipeline配置git parameter后在Jenkins的项目配置中会自动生成以下配置 通过标签拉取gitlab仓库代码
pipeline {agent anyenvironment {}parameters {gitParameter(branch: , branchFilter: .*, defaultValue: , description: Branch for build and deploy, name: tag, quickFilterEnabled: false, selectedValue: NONE, sortMode: NONE, tagFilter: *, type: PT_TAG)}stages {stage(pull code) {steps {checkout([$class: GitSCM, branches: [[name: ${tag}]], extensions: [], userRemoteConfigs: [[credentialsId: gitlab_auth, url: git10.1.60.114:gitlab-instance-c484dcfc/nodejs.git]]])}}}
}
在pipeline配置git parameter后在Jenkins的项目配置中会自动生成以下配置 注意通过标签拉取代码是没有分支信息的不要使用命令去输出分支的信息不然会报错 以上pipeline配置主要注意的是type需要配置对分支使用 PT_BRANCH标签使用PT_TAG