Pipeline Lib ORAS Retriever

Build Status Coverage LOC Jenkins Plugin GitHub release Contributors

Introduction

This plugin allow to fetch jenkins libraries stored into an OCI compliant registry (ORAS).

Warning

The ORAS Java SDK is currently in alpha state and might impact the stability of this plugin.

It's configuration and APIs might change in future releases

banner

Getting started

When configuring a pipeline job, just select the "Pipeline library from ORAS" option in the "Library" section.

Credentials are optional if using an unsecured registry. Otherwise you need to provide a username/password credential.

config.png

In order to consume a library you need to ensure to set the following artifact type application/vnd.jenkins.lib.manifest.v1+json

You can push such an artifact using the ORAS CLI:

oras push localhost:5000/lib:latest \
--artifact-type application/vnd.jenkins.lib.manifest.v1+json \
--annotation org.opencontainers.image.revision=sha1:$(git rev-parse HEAD) \
--annotation org.opencontainers.image.source=$(git config --get remote.origin.url) my-lib

When pushing a directory to oras, the src, vars, and resources can be set under a unique directory name, for example my-lib in the above command.

You will see then on the logs the digest of the library

log.png

LICENSE

Licensed under MIT, see LICENSE