public abstract class KeyMaterialFactory extends Object
Whenever you want to fork off docker directly or indirectly, use this object to set up environment variables so that docker will talk to the right daemon.
DockerServerEndpoint.newKeyMaterialFactory(AbstractBuild),
DockerRegistryEndpoint.newKeyMaterialFactory(AbstractBuild)| Modifier and Type | Field and Description |
|---|---|
static KeyMaterialFactory |
NULL |
| Constructor and Description |
|---|
KeyMaterialFactory() |
| Modifier and Type | Method and Description |
|---|---|
protected void |
checkContextualized() |
KeyMaterialFactory |
contextualize(KeyMaterialContext context)
Sets the
KeyMaterialContext within which this KeyMaterialFactory can materialize()
KeyMaterial instances. |
protected hudson.FilePath |
createSecretsDirectory()
Creates a read-protected directory inside
KeyMaterialContext.getBaseDir() suitable for storing secret files. |
protected KeyMaterialContext |
getContext() |
abstract KeyMaterial |
materialize()
Builds the key material environment variables needed to be passed when docker runs, to access
DockerServerCredentials that this object was created from. |
KeyMaterialFactory |
plus(KeyMaterialFactory... factories)
Merge additional
KeyMaterialFactorys into one. |
public static final KeyMaterialFactory NULL
protected void checkContextualized()
public KeyMaterialFactory contextualize(@Nonnull KeyMaterialContext context)
KeyMaterialContext within which this KeyMaterialFactory can materialize()
KeyMaterial instances. Can only be called once.context - the KeyMaterialContext.this (which is only returned to simplify use via method chaining)@Nonnull protected KeyMaterialContext getContext()
public abstract KeyMaterial materialize() throws IOException, InterruptedException
DockerServerCredentials that this object was created from.
When you are done using the credentials, call KeyMaterial.close() to allow sensitive
information to be removed from the disk.
IOExceptionInterruptedExceptionprotected final hudson.FilePath createSecretsDirectory()
throws IOException,
InterruptedException
KeyMaterialContext.getBaseDir() suitable for storing secret files.
Be sure to FilePath.deleteRecursive() this in KeyMaterial.close().IOExceptionInterruptedExceptionpublic KeyMaterialFactory plus(@Nullable KeyMaterialFactory... factories)
KeyMaterialFactorys into one.Copyright © 2016–2019. All rights reserved.