Upload Generic Files to JFrog Artifactory

Goal

Transfer a component version and upload its resources as plain files into an Artifactory generic repository, so that consumers download them by URL.

You’ll end up with

  • Each resource stored as a file in the Artifactory generic repository generic-local
  • Transferred resources with a Wget/v1 access on the stored files

Estimated time: ~10 minutes

Prerequisites

Steps

Configure the uploader

Add the credentials and one uploader rule for all LocalBlob resources to your .ocmconfig in the working directory (merged with $HOME/.ocmconfig):

type: generic.config.ocm.software/v1
configurations:
  - type: credentials.config.ocm.software
    consumers:
      - identity:
          type: Wget
          hostname: myorg.jfrog.io
          scheme: https
        credentials:
          - type: WgetCredentials/v1
            identityToken: <ARTIFACTORY_IDENTITY_TOKEN>
  - type: artifactory.uploader.transfer.config.ocm.software/v1alpha1
    match: resource.access.isType("LocalBlob")
    url: https://myorg.jfrog.io
    repository: generic-local
    # The default path written out, a starting point for your own layout:
    # path: '${component.name + "/" + component.version + "/" + resource.name + "-" + resource.version}'

Run the transfer

ocm transfer cv ctf::./src//ocm.software/demo:1.0.0 ctf::./target

Verify

ocm get cv ctf::./target//ocm.software/demo:1.0.0 -o yaml

The payload resource has this access:

access:
  type: Wget/v1
  url: https://myorg.jfrog.io/artifactory/generic-local/ocm.software/demo/1.0.0/payload-1.0.0
  mediaType: text/plain

Download the file:

curl -fsSL -H "Authorization: Bearer <ARTIFACTORY_IDENTITY_TOKEN>" https://myorg.jfrog.io/artifactory/generic-local/ocm.software/demo/1.0.0/payload-1.0.0

How the repository behaves

  • Any access type is accepted and the content is stored as is.
  • OCI images are uploaded as one gzipped OCI layout tar (application/vnd.ocm.software.oci.layout.v1+tar+gzip).
  • A second transfer reuses the stored file: reused content already stored in the artifactory repository.

Troubleshooting

For credential and overwrite errors, see Troubleshooting.