git - 使用经典 UI 在 Jenkins 管道上配置 git 超时

标签 git jenkins github groovy jenkins-pipeline

我需要克隆一个插件 git 公共(public)仓库(不是我的),压缩它,然后上传到我的服务器。

node {


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

那是我的代码,但是存储库很重,并且给了我 10 分钟的超时错误。我不知道它是否可以改变脚本的超时时间。

谢谢。

最佳答案

我终于可以做到了

这是我的代码:

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
}}

关于git - 使用经典 UI 在 Jenkins 管道上配置 git 超时,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/49699379/

相关文章:

GitLab:如何判断我对项目的访问级别?

git - Fish shell 改变了 git stash 引用的工作方式。如何配置 shell 来解决这个问题?

docker - 从Jenkins运行Docker Build,用参数替换Dockerfile中的硬编码输入

github - 在 GitHub 中为整个组织创建标签

git - 如果我从 GitHub 帐户中删除 GPG key 会怎样?

Git interactive rebase,无需使用编辑器即可编辑特定提交?

git - 如何将我的远程 git 存储库移动到另一个远程 git 存储库?

xcode - 尝试在 Jenkins 上使用 xcodebuild 使用 Cocoapods 构建应用程序时出现链接错误

java - 如何通过docker容器访问文件夹主机?

git - 托管多个 GitHub 网站