未知/额外键: - 作业[0] .plan [1] .image_resource

时间:2017-09-13 18:23:10

标签: concourse

我尝试使用所需图片更新管道。当我将这个配置用于我的第一份工作时:

- name: deploy
  plan:
  - aggregate:
    - get: go-time
      trigger: true
    - get: github-repo
  - task: deploy-<product>
    image_resource: &cli
      type: docker-image
      source:
        repository: <repo>/<image>
        tag: latest
    config:
      platform: linux
      inputs:
      - name: github-repo
      outputs:
      - name: current-deployment-id
        path: deployment_meta
      run:
        path: github-repo/ci/scripts/deploy.sh
        args:
          - ...
          - ...

我收到此错误:

unknown/extra keys:
  - jobs[0].plan[1].image_resource

什么会导致此错误?

1 个答案:

答案 0 :(得分:0)

image_resource键仅存在于任务配置中,因此您的工作应该类似于:

- name: deploy
  plan:
  - aggregate:
    - get: go-time
      trigger: true
    - get: github-repo
  - task: deploy-<product>
    config:
      platform: linux
      image_resource:
        type: docker-image
        source:
          repository: <repo>/<image>
          tag: latest
      inputs:
      - name: github-repo
      outputs:
      - name: current-deployment-id
        path: deployment_meta
      run:
        path: github-repo/ci/scripts/deploy.sh
        args:
          - ...
          - ...

我不确定&cli你应该提到的是什么,但你不应该提到它。你应该拥有的只是这里定义的内容:https://concourse-ci.org/single-page.html#image_resource