从管道提交的最佳方式是什么?作业从不同的存储库拉取并进行一些更改 + 生成 - 然后将新文件推送到其他存储库。这可能吗?
你应该使用 git 资源。
您要执行的操作的基本步骤是
- 从存储库拉取到容器中。
- 用代码做一些事情
- 将新代码移动到其他容器中
- 将该新容器的内容推送到不同的 git 存储库
您的管道配置应如下所示:
jobs:
- name: pull-code
plan:
- get: git-resource-pull
- get: git-resource-push
- task: do-something
inputs:
- name: git-resource-pull
run:
path: /bin/bash
args:
- -c
- |
pushd git-resource-pull
// do something
popd
// move the code from git-resource-pull to git-resource-push
- put: git-resource-push
params: {repository: git-resource-push}
resources:
- name: git-resource-pull
type: git
source:
uri: https://github.com/team/repository-1.git
branch: master
- name: git-resource-push
type: git
source:
uri: https://github.com/team/repository-2.git
branch: master