Class RegistryClient
java.lang.Object
io.jenkins.plugins.oras_artifacts.RegistryClient
@Restricted(org.kohsuke.accmod.restrictions.NoExternalUse.class)
public final class RegistryClient
extends Object
Wraps a
Registry-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final recordA file archived as a referrer of a build root artifact. -
Method Summary
Modifier and TypeMethodDescriptionvoidarchiveFile(String repository, String tag, String archivedPath, Path localFile) Attach a single archived file as a referrer of the build root artifact.booleanDelete the build root artifact and all its referrers.voiddeleteAllStashes(String repository) Delete all stashes (tags starting withstash-) for the given repository.voidensureBuildRoot(String repository, String tag, String jobFullName, int buildNumber) Ensure the build root artifact exists for the given repository/tag, creating it if needed.booleanReturn whether a manifest exists for the given repository/tag.findArchivedFile(String repository, String tag, String path) Find a single archived file by its path.booleanWhether a stash exists.listArchivedFiles(String repository, String tag) List all files archived for the given repository/tag by querying the OCI referrers API of the build root artifact digest.Open a stream to download the content of an archived file.voidPull the content of a stash to the given target file.voidPush a stash (a single tar.gz artifact) under the given repository/name.voidtestConnection(String repository) Test the connection to the registry by pushing and deleting a small artifact.
-
Method Details
-
exists
-
ensureBuildRoot
-
archiveFile
Attach a single archived file as a referrer of the build root artifact.- Parameters:
repository- the repository (sanitized job full name)tag- the build root tagarchivedPath- the archived path, relative to the artifacts root (e.g."dir/file.txt")localFile- the local file to upload
-
listArchivedFiles
List all files archived for the given repository/tag by querying the OCI referrers API of the build root artifact digest. -
findArchivedFile
public Optional<RegistryClient.ArchivedFile> findArchivedFile(String repository, String tag, String path) Find a single archived file by its path. -
openFile
Open a stream to download the content of an archived file.- Throws:
IOException
-
delete
-
pushStash
-
hasStash
-
pullStash
-
deleteAllStashes
Delete all stashes (tags starting withstash-) for the given repository. -
testConnection
Test the connection to the registry by pushing and deleting a small artifact.- Throws:
IOException
-