詹金斯git超时杀戮过程

时间:2017-09-21 09:48:03

标签: git jenkins

我正在运行Jenkins管道,使用以下命令从repo中获取/克隆代码:

git branch: 'master', credentialsId: 'jenkins_ssh_key', url: 'git@github.com:myrepo/myrepo.git'

由于repo的大小,该进程在10分钟后被杀死,因为git插件有10分钟超时。

有没有办法在Jenkins管道中增加git插件超时的大小?

注意:我已经看到你可以在自由式项目中增加超时,但是如何在管道中完成?

1 个答案:

答案 0 :(得分:0)

使用checkout插件的长格式。例如,我将签出和克隆超时值设置为60分钟。

def checkout_scm() {
    checkout(
        scm: [$class                           : 'GitSCM',
              branches                         : [[name: 'maser']],
              doGenerateSubmoduleConfigurations: false, extensions: [[$class: 'CleanBeforeCheckout'],
                                                                    [$class: 'CheckoutOption', timeout: 60],
                                                                    [$class: 'CloneOption', noTags: true, reference: '', shallow: true, timeout: 60]],
              submoduleCfg                     : [],
              userRemoteConfigs                : [[credentialsId: 'jenkins-ssh-creds', url: 'git@company.org:project/some_repo.git']]]
            )
}

node('linux') {
    stage('Checkout') {
        checkout_scm()
    }
}