【问题标题】:Concourse get bitbucket resource error unmarshaling JSON: while decoding JSONConcourse 在解组 JSON 时获取 bitbucket 资源错误:解码 JSON 时
【发布时间】:2020-06-08 21:43:04
【问题描述】:

我正在尝试创建带有大厅的管道,但遇到了意外的 json 错误。 有人可以帮我弄清楚问题出在哪里以及如何解决吗? 下面,您将找到相关文件和信息。

非常感谢您的宝贵时间。

命令

sudo fly -t tutorial set-pipeline -c pipeline.yml -p simple-task -l my-vars.yml my-key.yml --verbose

错误:

2020/06/08 23:31:28 GET /api/v1/info HTTP/1.1
Host: 127.0.0.1:8080
User-Agent: Go-http-client/1.1
Accept-Encoding: gzip


2020/06/08 23:31:28 HTTP/1.1 200 OK
Content-Length: 82
Content-Type: application/json
Date: Mon, 08 Jun 2020 21:31:28 GMT
Vary: Accept-Encoding
X-Concourse-Version: 6.2.0
X-Content-Type-Options: nosniff
X-Download-Options: noopen
X-Frame-Options: deny
X-Xss-Protection: 1; mode=block

{"version":"6.2.0","worker_version":"2.2","external_url":"http://localhost:8080"}

2020/06/08 23:31:28 GET /api/v1/teams/main/pipelines/simple-task/config HTTP/1.1
Host: 127.0.0.1:8080
User-Agent: Go-http-client/1.1
Accept-Encoding: gzip


2020/06/08 23:31:28 HTTP/1.1 404 Not Found
Date: Mon, 08 Jun 2020 21:31:28 GMT
Vary: Accept-Encoding
X-Concourse-Version: 6.2.0
X-Content-Type-Options: nosniff
X-Download-Options: noopen
X-Frame-Options: deny
X-Xss-Protection: 1; mode=block
Content-Length: 0

pipeline.yml

---
resources:
    name: source-code
    type: git
    source: ((pipelines_source))
jobs:
  - name: job
    public: true
    plan:
      - get: source-code
        trigger: true
      - task: simple-task
        config:
          platform: linux
          image_resource:
            type: registry-image
            source: { repository: aretelabs/nomad-resource }
          run:
            path: echo
            args: ["Ready"]

my-vars.yml

---
pipelines_source:
      branch: master
      uri: git@bitbucket.org:username/repo.git 
      private_key: ((private_key))

my-key.yml

private_key: -----BEGIN OPENSSH PRIVATE KEY-----
... blablabla ...
-----END OPENSSH PRIVATE KEY-----

【问题讨论】:

    标签: json get yaml bitbucket concourse


    【解决方案1】:

    您缺少资源名称前面的-。由于 YAML 被转换为 JSON,您需要按以下方式格式化 pipeline.yml 文件以指示有效的键值对。

    ---
    resources:
      - name: source-code
        type: git
        source: ((pipelines_source))
    jobs:
      - name: job
        public: true
        plan:
          - get: source-code
            trigger: true
          - task: simple-task
            config:
              platform: linux
              image_resource:
                type: registry-image
                source: { repository: aretelabs/nomad-resource }
              run:
                path: echo
                args: ["Ready"]
    

    【讨论】:

      猜你喜欢
      • 2020-10-04
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2013-03-19
      • 1970-01-01
      相关资源
      最近更新 更多