3

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

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

resources:
- name: artifactory-repository
  type: artifactory
  check_every: 1m
  source:
    endpoint: https://artifactory.localnet.net:443/artifactory/
    repository: "cf-artifacts"
    regex: "myapp-(?<version>.*).txt"
    username: {{artifactory_username}}
    password: {{artifactory_password}}
    skip_ssl_verification: true

jobs:
- name: 1-build-an-artifact
  plan:
  - task: create-artifact
    config:
      platform: linux
      image_resource:
        type: docker-image
        source:
          repository: ubuntu
      outputs:
      - name: build
      run:
        path: sh
        args:
        - -exc
        - |
          echo "This is my file content." > ./build/myapp-1.0.0.txt
          find .
  - put: artifactory-repository
    params: { file: ./build/myapp-*.txt }

- name: 2-trigger-when-new-file-is-added-to-artifactory
  plan:
  - get: artifactory-repository
    trigger: true
    passed:
      - 1-build-an-artifact
  - task: use-new-file
    config:
      platform: linux
      image_resource:
        type: docker-image
        source:
          repository: ubuntu
      inputs:
      - name: artifactory-repository
      run:
        path: cat
        args:
        - "./artifactory-repository/myapp*.txt"

Respositories are all present:

enter image description here

However, my pipeline is exiting with an error:

jq: error (at :5): Cannot iterate over null (null) file for version '1.0.0' not found

Screenshot:

enter image description here

All help is very appreciated.

user2362699
  • 586
  • 6
  • 22

1 Answers1

1

Removing / at the end of the endpoint URL resolves my issue.

endpoint: https://artifactory.localnet.net:443/artifactory/ ------> to

endpoint: https://artifactory.localnet.net:443/artifactory

Community
  • 1
  • 1