如何解决Concourse CI git将多个存储库克隆到同一目录
谁能帮我实现我的要求。我想将多个 repos git clone 到下载第一个 git repo 的同一目录中。下面是我的 pipeline.yml
文件。非常感谢任何帮助。
resources:
- name: workspace-repo1
type: git
source:
uri: <git-repo1-url>
branch: master
private_key: ((publishing-outputs-private-key))
- name: workspace-repo2
type: git
source:
uri: <git-repo2-url>
branch: master
private_key: ((publishing-outputs-private-key))
- name: workspace-repo3
type: git
source:
uri: <git-repo3-url>
branch: master
private_key: ((publishing-outputs-private-key))
jobs:
- name: job-test
public: true
plan:
- get: workspace-repo1
- get: workspace-repo2
- get: workspace-repo3
- task: app-tests
config:
platform: linux
image_resource:
type: docker-image
source: {repository: golang,tag: 1.14.15-stretch}
inputs:
- name: workspace-repo1 (git repo1,repo2,repo3 should be downloaded here)
outputs:
- name: workspace-repo-deb
run:
path: workspace-repo1/local_build.sh
解决方法
你可能会做类似的事情
- task: prep
file: scripts/merge.yml
input_mapping: {repo1: workspace-1,repo1: workspace-2,...}
---
platform: linux
image_resource:
type: docker-image
source:
repository: alpine
params:
#this could whatever path you want
SRC_PATH: src
inputs:
- name: ci-scripts
- name: repo1
- name: repo2
run:
path: scripts/merge.sh
#this output could be use in the next step,it contains the directories you copied in the script below
outputs:
- name: build
#!/bin/sh
set -e
mkdir -p build
#copy around anything you need
cp -rf repo1/../../. build/
cp -rf repo2/../../. build/
cp -rf repo3/../../. build/
#listing content of build folder just checking
ls -la build/
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。