【问题标题】:Concourse: Resource not found?大厅:找不到资源?
【发布时间】:2018-03-08 18:04:32
【问题描述】:

我正在尝试构建一个由 git 触发的大厅管道,然后在该 git 存储库中运行一个脚本。

这是我目前所拥有的:

resources:

- name: component_structure_git
  type: git
  source:
    branch: master
    uri: git@bitbucket.org:foo/bar.git

jobs:
- name: component_structure-docker
  serial: true
  plan:
  - aggregate:
    - get: component_structure_git
      trigger: true
    - task: do-something
      config:
        platform: linux
        image_resource:
          type: docker-image
          source: { repository: ubuntu }
        inputs:
          - name: component_structure_git
        outputs:
          - name: updated-gist  
        run:
          path: component_structure_git/run.sh
  - put: component_structure-docker
    params:
      build: component_structure/concourse

- name: component_structure-deploy-test
  serial: true
  plan:
  - aggregate:
    - get: component_structure-docker
      passed: [component_structure-docker]

- name: component_structure-deploy-prod
  serial: true
  plan:
  - aggregate:
    - get: component_structure-docker
      passed: [component_structure-docker]

当我使用 fly 应用此代码时,一切正常。当我尝试运行构建时。它失败并出现以下错误:

缺少输入:component_structure_git

知道我在这里缺少什么吗?

【问题讨论】:

    标签: continuous-integration concourse


    【解决方案1】:

    同意第一个答案。并行运行(聚合块)时,需要考虑一些事项

    1. 我有多少个输入?我有不止一个,让我们在一个聚合块中运行这些get 步骤
    2. 如果我有两个任务,任务之间是否存在可以改变任务运行结果的依赖关系,例如。我是否有下一项任务所需的一项任务的输出
    3. 我有一系列put 语句,让我们在聚合块中运行这些步骤

    【讨论】:

      【解决方案2】:

      只是一个猜测,但聚合导致了这个问题。您不能从同时执行的某些东西中获得输入吗?为什么你还有聚合?这通常用于“获取”以加快进程。

      【讨论】:

        猜你喜欢
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        相关资源
        最近更新 更多