Jenkins GitLab 集成代码下载部分

网友投稿 627 2022-11-30

Jenkins GitLab 集成代码-部分

Jenkins GitLab 集成代码-部分

代码-部分

找一个pipeline 类型的项目进入流水线语法, 找到片段生成器中的 ​​checkout​​ 。 我们使用checkout方法来进行代码-(svn也是支持的哦)

checkout([$class: 'GitSCM', branches: [[name: '*/master']], extensions: [], userRemoteConfigs: [[credentialsId: '655050bf-da7e-4ca6-85f3-3fb03b2155ad', url: '{ "id": 3, "name": "devops-hello-service", "description": "", "web_url": " "avatar_url": null, "git_ssh_url": "git@76c03cb0fea1:devops/devops-hello-service.git", "git_" "namespace": "devops", "visibility_level": 0, "path_with_namespace": "devops/devops-hello-service", "default_branch": "master", "ci_config_path": null, "homepage": " "url": "git@76c03cb0fea1:devops/devops-hello-service.git", "ssh_url": "git@76c03cb0fea1:devops/devops-hello-service.git", "" },

def credentialsId = "655050bf-da7e-4ca6-85f3-3fb03b2155ad"webHookData = readJSON text: "${webHookData}"env.userName = webHookData["user_username"]env.userEmail = webHookData["user_email"]env.branchName = webHookData["ref"] - "refs/heads/"env.commitID = webHookData["checkout_sha"]env.git_= webHookData["project"]["git_= env.commitIDcurrentBuild.description = "Trigger by user ${env.userName} \n branch: ${env.branchName}"pipeline { agent any stages { stage('CheckOut') { steps { println("project git url is ${git_") checkout([$class: 'GitSCM', branches: [[name: "${env.branchName}"]], extensions: [], userRemoteConfigs: [[credentialsId: "${credentialsId}", url: "${env.git_ } } }}

版权声明:本文内容由网络用户投稿,版权归原作者所有,本站不拥有其著作权,亦不承担相应法律责任。如果您发现本站中有涉嫌抄袭或描述失实的内容,请联系我们jiasou666@gmail.com 处理,核实后本网站将在24小时内删除侵权内容。

上一篇:NexusAPI调试方法
下一篇:计算机网络 物理层 数据通信的基础知识
相关文章

 发表评论

暂时没有评论,来抢沙发吧~