0

有人可以帮我实现我的要求。我想将多个 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

4

1 回答 1

1

你可能会做类似的事情

  - 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/

于 2021-02-27T22:59:51.327 回答