我使用 Concourse 作为我的 CI 管道,我的管道基本上从 git 资源中的一些文件构建一个 rpm,然后将 rpm 放在另一个 git 存储库中。当我第一次创建 repo 并运行 concourse 管道时,它将 rpm 放入 repo 中没有任何问题。但是,随后的 Put 因以下 git 错误而失败。
> Identity added: /tmp/git-resource-private-key (/tmp/git-resource-private-key)
To git@github.private.com:private/repo1.git
! [rejected] HEAD -> master (fetch first)
error: failed to push some refs to 'git@github.private.com:username/repo1.git'
hint: Updates were rejected because the remote contains work that you do
hint: not have locally. This is usually caused by another repository pushing
hint: to the same ref. You may want to first integrate the remote changes
hint: (e.g., 'git pull ...') before pushing again.
hint: See the 'Note about fast-forwards' in 'git push --help' for details.
这是我的 pipeline.yml
---
jobs:
- name: job-build
serial: true
plan:
- get: Inputbuild
trigger: true
- task: <task-name>
config:
…
…
inputs:
- name: Inputbuild
outputs:
- name: outputbuild-dir
run:
path: Inputbuild/script.sh
- put: outputbuild
params: {repository: outputbuild-dir}
resources:
- name: Inputbuild
type: git
source:
uri: git@github.private.com:username/repo.git
branch: master
private_key: {{private_github_key}}
- name: outputbuild
type: git
source:
uri: git@github.private.com:username/repo1.git
branch: master
private_key: {{private_github_repo1_key}}