小编mur*_*thi的帖子

如何在脚本化管道中的结帐(scm)中指定深度

我们的项目仓库非常大(2.5GB)。因此,在脚本化管道中的 checkout(scm) 步骤中,代码需要更长的时间从 GIT 克隆。由于 GIT 试图获取整个历史记录,我们面临以下错误。

到目前为止,我已经尝试过 checkout(scm),我在https://jenkins.io/doc/pipeline/steps/workflow-scm-step/中读到 ,有一个名为“深度”的选项,通过它我们只能下载最近的承诺。

但我不知道它的语法。

node(nodeName) {
    try {
    deleteDir()
    checkout(scm)
        ....
        ....
    }
    catch(Exception ex) {
        throw ex
    }    
}
Run Code Online (Sandbox Code Playgroud)

如果克隆时间减少,那将是非常有益的。执行线路结账(scm)后,

我们有时会收到以下错误。

using credential Servicejenkins_build
Cloning the remote Git repository
Cloning with configured refspecs honoured and without tags
Cloning repository 
hudson.plugins.git.GitException: Command "C:\Git\cmd\git fetch --no-tags --progress https://gitlab.com/../../supportforpc.git +refs/heads/*:refs/remotes/origin/*" returned status code 128:
stdout: 
stderr: remote: Enumerating objects: 1           
remote: Enumerating objects: 24671, done.        
remote: Counting objects:   0% (1/24671)           
remote: Counting objects: …
Run Code Online (Sandbox Code Playgroud)

jenkins jenkins-groovy jenkins-pipeline

8
推荐指数
1
解决办法
1万
查看次数

将int数组转换为c ++中int的向量

我有一个像这样的数组

int A[] = {1, 2, 3, 4, 5, 6, 7}
vector<int> vec;
int index = 0;
for(int i = 0; i < A.size(); i++) {
if(some condition) {
    index = i;
}
**vec(A + index, i);**
}
Run Code Online (Sandbox Code Playgroud)

如何将数组转换为从特定索引开始的向量,如上所述?

c++ arrays vector

1
推荐指数
1
解决办法
299
查看次数

标签 统计

arrays ×1

c++ ×1

jenkins ×1

jenkins-groovy ×1

jenkins-pipeline ×1

vector ×1