背景:
pipeline都根本是一个模板,参照:Jenkins Pipeline演进。最近新上了一个我的项目。springcloud的聚合工程,8个子我的项目。原本是要求程序间接提交代码到gitlab,我间接本人maven打包,并且docker build构建镜像并公布到线上环境。然而程序喜爱集体提交jar包(每个jar包100m左右)。gitlab比拟老只开明了http形式,并没有开明ssh形式。开始还好jenkins还能公布,昨天晚上间接不能公布了....报错如下:
RPC failed; HTTP 504 curl 22 The requested URL returned error: 504 Gateway Time-out
解决问题思路:
嗯git文件过大!。解决形式无非两种:
1.减少ssh形式
clone形式批改为ssh。老的不想动了,并且容器外面clone构建的。整ssh的形式就不采纳了。
2.获取最新的版本--depth=1的形式
如下:
stage("GetCode"){ agent { label "build01" } steps{ script{ println("下载代码 --> 分支: ${env.branchName}") checkout([$class: 'GitSCM', branches: [[name: "${env.branchName}"]], doGenerateSubmoduleConfigurations: false, extensions: [[$class: 'CloneOption', depth: 1, noTags: false, reference: '', shallow: true]], submoduleCfg: [], userRemoteConfigs: [[credentialsId: 'laya-open-php', url: "${env.gitHttpURL}"]]]) } } }
extensions参数中减少depth等参数!
嗯总算能够拉动代码了