简体   繁体   中英

Retrieving JFrog Artifact via Concourse pipeline - "empty version - return current version"

Trying to test artifactory-resource by running through the example pipeline.

groups:
  - name: all
    jobs:
      - set-pipeline
      - trigger-when-new-file-is-added-to-artifactory

  jobs:
  - name: set-pipeline
    serial: true
    plan:
      - in_parallel:
        - get: ea-terraform-module-aws-rds
          trigger: true
      - set_pipeline: deploying-rds-instance-from-jfrog-artifact
        file: ea-terraform-module-aws-rds/examples/concourse/ea-terraform-module-aws-rds.yml

  - name: trigger-when-new-file-is-added-to-artifactory
    plan:
      - get: ea-rds-jfrog-repo
      - task: use-new-file
        config:
          platform: linux
          image_resource:
            type: docker-image
            source:
              repository: ubuntu
          inputs:
            - name: ea-rds-jfrog-repo
          run:
            path: cat
            args:
              - "./ea-rds-jfrog-repo/ea-terraform-module-aws-rds*.zip"

resource_types:
  - name: artifactory
    type: docker-image
    source:
      repository: pivotalservices/artifactory-resource

  resources:
  - name: ea-rds-jfrog-repo
    type: artifactory
    check_every: 1m
    source:
      endpoint: https://xxx.jfrog.io/artifactory
      repository: "ea-terraform-module-aws-rds-1.4.0.zip"
      regex: "ea-terraform-module-aws-rds-(?<version>.*).zip"
      username: ${JF_USER}
      password: ${JF_PASSWORD}

  - name: ea-terraform-module-aws-rds
    type: git
    source:
      private_key: ((github_private_key))
      uri: git@github.com:xxx/xxx
      branch: SAAS-27134

Concourse Error: pipeline path -> deploying-rds-isntance-from-jfrog-artifact/ea-rds-jfrog-repo

enter image description here

Repo on JFrog Artifactory

enter image description here

tried adding a version parameter

The following error indicates that the concourse resource is making a call to the Artifactory API, but instead of receiving a JSON structure, it gets a null response instead. The resource passes the null response to the jq utility that assumes an iterable object.

So why does it get a null response from the API?

It looks like, at minimum, the repository: in the ea-rds-jfrog-repo resource definition is incorrect.

Based on the second snapshot: I'm going to guess it should be set to

repository: "/ea-terraform-module-aws-rds/terraform-module/aws"

I recommend using the https://github.com/spring-io/artifactory-resource which is in active development, instead of the unmaintained one from pivotalservices

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM