欢迎访问 生活随笔!

生活随笔

当前位置: 首页 > 编程资源 > 编程问答 >内容正文

编程问答

Jenkins(Pipeline)

发布时间:2025/3/15 编程问答 32 豆豆
生活随笔 收集整理的这篇文章主要介绍了 Jenkins(Pipeline) 小编觉得挺不错的,现在分享给大家,帮大家做个参考.
  • 安装pipline 插件(一般情况,pipline 是已安装的)

  • 参数化配置中选择 Git Parameter    

  •     name: branchParameter type:Branch

    3. 配置Pipeline

    Pipeline script  #在jenkins 页面配置脚本 Pipeline script from SCM #在脚本服务器中配置脚本,通过git 获取配置脚本信息

    4.测试脚本

    node('web') {                  //此处配置slave node// def mvnHomestage('checkout') { // for display purposescheckout([$class: 'GitSCM', branches: [[name: '*/master']], doGenerateSubmoduleConfigurations: false, extensions: [], submoduleCfg: [], userRemoteConfigs: [[url: 'git@10.10.95.2:/home/git/repos/app.git']]])}stage('maven build') {echo 'maven build ....'echo 'maven build .....'echo 'maven build .....'}stage('deploy') {echo 'deploy .....'echo 'deploy .....'echo 'deploy ......'}stage('test') {echo 'test ......'echo 'test ........'echo 'test .......'} }

    5. 测试服务器中获取脚本

    在脚本服务器中配置脚本信息,提交到git 服务器,Jenkins 从git服务器中获取脚本,更新代码 例如:git add .git commit -m ""git push origin master




    转载于:https://blog.51cto.com/11726705/2345339

    总结

    以上是生活随笔为你收集整理的Jenkins(Pipeline)的全部内容,希望文章能够帮你解决所遇到的问题。

    如果觉得生活随笔网站内容还不错,欢迎将生活随笔推荐给好友。