Coordinate Concourse CI Same-Repo 检查?

问题描述 投票:0回答:1

我有一个 Concourse CI 模式,其中在一个 repo 中定义了多个管道。我想测试 entire 存储库,然后仅当某些文件已更改(即特定于管道的 YAML)时才应用那些已更改的管道。它 mostly 工作 - 除了当这些文件发生变化时它会立即应用管道而无需等待整个 repo 得到测试。

这是我配置的相关部分:

resources:
  - name: "repo-self"
    type: git
    source:
      uri: "[email protected]:some-repo.git"
      branch: main
  - name: "repo-self-pipeline-1" # for triggering setting that pipeline
    type: git
    source:
      uri: "[email protected]:some-repo.git"
      branch: main
      paths:
        - "concourse/pipeline-1/*"
jobs:
  - name: testing
    plan:
      - get: "repo-self"
        trigger: true
      - in_parallel:
          - task: "test-1"
          - task: "test-2"
          - task: "test-3"
  - name: "set-pipeline-1"
    plan:
      - in_parallel:
          - get: "repo-self"
            passed:
              - testing
          - get: "repo-self-pipeline-1"
            trigger: true
      - set_pipeline: "pipeline-1"
        file: "repo-self-pipeline-1/concourse/pipeline-1/main.yaml"

我不能简单地添加相同的

passed
指令来设置管道,因为没有直接测试 git repo 资源。而且我不想 also 通过测试运行它,因为理想情况下它是同一个 git sha - 它只是碰巧更改了我关心的文件。

有什么方法可以控制或以其他方式将“repo-self-pipeline-1”锁定到与“repo-self”相同的 sha?

concourse concourse-pipeline concourse-git-resource concourse-task
1个回答
0
投票

在没有触发器的情况下将

- get: "repo-self-pipeline-1"
添加到
testing
工作。无需在该回购上运行测试。然后将
passed: testing
添加到第二份工作的第二个回购中。那应该可以解决问题。

© www.soinside.com 2019 - 2024. All rights reserved.