Jose Pinto
Jose Pinto

Reputation: 111

Configure git timeout on Jenkins pipeline with Classic UI

I need to clone a plugin git public repository(that is not mine), zip it, and upload it to my server.

node {


stage('clone') { // for display purposes
    // Get some code from a GitHub repository
    git branch: 'master',
        url: 'https://github.com/LimeSurvey/LimeSurvey.git'
}
}

Thats my code, but the repository is heavy and gives me a 10min timeout error. I dont know if its a way to change the timeout time on the script.

Thanks.

Upvotes: 3

Views: 8418

Answers (1)

Jose Pinto
Jose Pinto

Reputation: 111

I finally could do it

Here's my code:

node {

stage('clone') { // for display purposes
    // Get some code from a GitHub repository
    checkout([$class: 'GitSCM',
        branches: [[name: '*/master']],
        extensions: [[$class: 'CloneOption', timeout: 120]],
        gitTool: 'Default', 
        userRemoteConfigs: [[url: 'https://github.com/LimeSurvey/LimeSurvey.git']]
    ])
}

stage('zip'){
    zip zipFile: './publish.zip',
        archive: true
}}

Upvotes: 8

Related Questions