首页 文章

GoCD:如何设置管道依赖项

提问于
浏览
1

我有两个存储库(材料)git1和git2 .

在git1提交我需要管道来触发,克隆git2 repo,并执行一些工作 . 怎么做?

问题是如果我添加git2作为管道材料,它也会触发这个材料,而我只需要获取git2来执行工作 .

1 回答

  • 0

    您将两个存储库添加为材料,并在第二个git仓库中使用ignore过滤器 * (所有顶级文件)和 **/* (子目录中的所有文件):

    <git url="https://github.com/somebody/repo2.git"
            dest="some-directory">
        <filter>
            <ignore pattern="*" />
            <ignore pattern="**/*" />
        </filter>
    </git>
    

    这样,将检出当前版本的repo2,但是推送到repo2不会触发新的构建 .

相关问题