public class DockerRegistryEndpoint extends hudson.model.AbstractDescribableImpl<DockerRegistryEndpoint>
As Describable it comes with pre-baked configuration form that you can use in
your builders/publishers/etc that interact with Docker daemon.
| Modifier and Type | Class and Description |
|---|---|
static class |
DockerRegistryEndpoint.DescriptorImpl |
| Constructor and Description |
|---|
DockerRegistryEndpoint(String url,
String credentialsId) |
| Modifier and Type | Method and Description |
|---|---|
boolean |
equals(Object obj) |
static DockerRegistryEndpoint |
fromImageName(String s,
String credentialsId)
Parse the registry endpoint out of a registry:port/namespace/name:tag string as created by
imageName(String). |
String |
getCredentialsId()
ID of the credentials used to talk to this endpoint.
|
URL |
getEffectiveUrl()
Gets the endpoint URL, such as "https://index.docker.io/v1/"
|
DockerRegistryToken |
getToken(hudson.model.Item context)
Deprecated.
Call
getToken(Run) |
String |
getUrl()
For stapler.
|
int |
hashCode() |
String |
imageName(String userAndRepo)
Decorates the repository ID namespace/name (ie.
|
KeyMaterialFactory |
newKeyMaterialFactory(hudson.model.AbstractBuild build)
|
KeyMaterialFactory |
newKeyMaterialFactory(hudson.model.Item context,
hudson.FilePath workspace,
hudson.Launcher launcher,
hudson.EnvVars env,
hudson.model.TaskListener listener,
String dockerExecutable)
|
KeyMaterialFactory |
newKeyMaterialFactory(hudson.model.Item context,
hudson.FilePath workspace,
hudson.Launcher launcher,
hudson.model.TaskListener listener,
String dockerExecutable)
|
KeyMaterialFactory |
newKeyMaterialFactory(hudson.model.Item context,
hudson.remoting.VirtualChannel target)
|
KeyMaterialFactory |
newKeyMaterialFactory(hudson.model.Item context,
hudson.remoting.VirtualChannel target,
hudson.Launcher launcher,
hudson.model.TaskListener listener)
|
KeyMaterialFactory |
newKeyMaterialFactory(hudson.model.Run context,
hudson.FilePath workspace,
hudson.Launcher launcher,
hudson.EnvVars env,
hudson.model.TaskListener listener,
String dockerExecutable)
Makes the credentials available locally and returns
KeyMaterialFactory that gives you the parameters
needed to access it. |
String |
toString() |
public static DockerRegistryEndpoint fromImageName(String s, @CheckForNull String credentialsId)
imageName(String). Credentials are set to the id passed. The url is built from registry:port into
https://registry:port, the same way docker push does.s - credentialsId - passed to the constructor, can be nullIllegalArgumentException - if string can't be parsed@Nonnull public URL getEffectiveUrl() throws IOException
IOException@Nullable public String getCredentialsId()
@Deprecated @CheckForNull public DockerRegistryToken getToken(hudson.model.Item context)
getToken(Run)IdCredentials should do so via ID string,
and use this method to resolve it and convert to DockerRegistryToken.
Implements the logic CredentialsProvider.findCredentialById(String, Class, Run, DomainRequirement...)
but for an Item.context - If you are a build step trying to access DockerHub in the context of a build/job,
specify that job. Otherwise null. If you are scoped to something else, you might
have to interact with CredentialsProvider directly.@Deprecated public KeyMaterialFactory newKeyMaterialFactory(@Nonnull hudson.model.AbstractBuild build) throws IOException, InterruptedException
IOExceptionInterruptedException@Deprecated public KeyMaterialFactory newKeyMaterialFactory(hudson.model.Item context, @Nonnull hudson.remoting.VirtualChannel target) throws IOException, InterruptedException
IOExceptionInterruptedException@Deprecated public KeyMaterialFactory newKeyMaterialFactory(@CheckForNull hudson.model.Item context, @Nonnull hudson.remoting.VirtualChannel target, @CheckForNull hudson.Launcher launcher, @Nonnull hudson.model.TaskListener listener) throws IOException, InterruptedException
IOExceptionInterruptedException@Deprecated public KeyMaterialFactory newKeyMaterialFactory(@CheckForNull hudson.model.Item context, @Nonnull hudson.FilePath workspace, @Nonnull hudson.Launcher launcher, @Nonnull hudson.model.TaskListener listener, @Nonnull String dockerExecutable) throws IOException, InterruptedException
IOExceptionInterruptedException@Deprecated public KeyMaterialFactory newKeyMaterialFactory(@CheckForNull hudson.model.Item context, @Nonnull hudson.FilePath workspace, @Nonnull hudson.Launcher launcher, @Nonnull hudson.EnvVars env, @Nonnull hudson.model.TaskListener listener, @Nonnull String dockerExecutable) throws IOException, InterruptedException
IOExceptionInterruptedExceptionpublic KeyMaterialFactory newKeyMaterialFactory(@CheckForNull hudson.model.Run context, @Nonnull hudson.FilePath workspace, @Nonnull hudson.Launcher launcher, @Nonnull hudson.EnvVars env, @Nonnull hudson.model.TaskListener listener, @Nonnull String dockerExecutable) throws IOException, InterruptedException
KeyMaterialFactory that gives you the parameters
needed to access it.context - The build trying to access DockerHubworkspace - a workspace being used for operations (WorkspaceList.tempDir(hudson.FilePath) will be applied)dockerExecutable - as in DockerTool.getExecutable(java.lang.String, hudson.model.Node, hudson.model.TaskListener, hudson.EnvVars), with a 1.8+ clientIOExceptionInterruptedExceptionpublic String imageName(@Nonnull String userAndRepo) throws IOException
userAndRepo - the namespace/name part to append to the registryIOExceptionCopyright © 2016–2019. All rights reserved.