Class SSHAgentBuildWrapper
java.lang.Object
hudson.model.AbstractDescribableImpl<BuildWrapper>
hudson.tasks.BuildWrapper
com.cloudbees.jenkins.plugins.sshagent.SSHAgentBuildWrapper
- All Implemented Interfaces:
ExtensionPoint, Describable<BuildWrapper>
A build wrapper that provides an SSH agent using supplied credentials
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classA value object to make it possible to pass back multiple credentials via the UI.static classOur descriptor.Nested classes/interfaces inherited from class BuildWrapper
BuildWrapper.EnvironmentNested classes/interfaces inherited from interface ExtensionPoint
ExtensionPoint.LegacyInstancesAreScopedToHudson -
Constructor Summary
ConstructorsConstructorDescriptionSSHAgentBuildWrapper(SSHAgentBuildWrapper.CredentialHolder[] credentialHolders, boolean ignoreMissing) SSHAgentBuildWrapper(SSHAgentBuildWrapper.CredentialHolder[] credentialHolders, boolean ignoreMissing, int timeout) Constructs a new instance.SSHAgentBuildWrapper(String user) Deprecated.SSHAgentBuildWrapper(List<String> credentialIds, boolean ignoreMissing) Deprecated.SSHAgentBuildWrapper(List<String> credentialIds, boolean ignoreMissing, int timeout) Constructs a new instance. -
Method Summary
Modifier and TypeMethodDescriptionstatic Stringdescription(com.cloudbees.plugins.credentials.common.StandardUsernameCredentials c) Helper method that returns a safe description of aStandardUsernameCredentials.Returns the value objects used to hold the credential ids.Gets theIdCredentials.getId()s of the credentials to use.intThe timeout (in minutes) for ssh agent commands.getUser()Deprecated.booleanWhentruethen any missing credentials will be ignored.voidpreCheckout(AbstractBuild build, Launcher launcher, BuildListener listener) setUp(AbstractBuild build, Launcher launcher, BuildListener listener) Methods inherited from class BuildWrapper
all, decorateLauncher, decorateLogger, getProjectAction, getProjectActions, makeBuildVariables, makeSensitiveBuildVariables, setUpMethods inherited from class AbstractDescribableImpl
getDescriptor
-
Constructor Details
-
SSHAgentBuildWrapper
Deprecated.Constructs a new instance.- Parameters:
user- theIdCredentials.getId()of the credentials to use.
-
SSHAgentBuildWrapper
public SSHAgentBuildWrapper(SSHAgentBuildWrapper.CredentialHolder[] credentialHolders, boolean ignoreMissing) -
SSHAgentBuildWrapper
Deprecated. -
SSHAgentBuildWrapper
@DataBoundConstructor public SSHAgentBuildWrapper(SSHAgentBuildWrapper.CredentialHolder[] credentialHolders, boolean ignoreMissing, int timeout) Constructs a new instance.- Parameters:
credentialHolders- theSSHAgentBuildWrapper.CredentialHolders of the credentials to use.ignoreMissing-truemissing credentials will not cause a build failure.- Since:
- 1.5
-
SSHAgentBuildWrapper
-
-
Method Details
-
getUser
Deprecated.Gets theIdCredentials.getId()of the credentials to use.- Returns:
- the
IdCredentials.getId()of the credentials to use.
-
getCredentialIds
-
isIgnoreMissing
public boolean isIgnoreMissing()Whentruethen any missing credentials will be ignored. Whenfalsethen the build will be failed if any of the required credentials cannot be resolved.- Returns:
truemissing credentials will not cause a build failure.
-
getTimeout
public int getTimeout()The timeout (in minutes) for ssh agent commands.- Returns:
- the startup timeout in minutes.
-
getCredentialHolders
Returns the value objects used to hold the credential ids.- Returns:
- the value objects used to hold the credential ids.
- Since:
- 1.5
-
preCheckout
public void preCheckout(AbstractBuild build, Launcher launcher, BuildListener listener) throws IOException, InterruptedException - Overrides:
preCheckoutin classBuildWrapper- Throws:
IOExceptionInterruptedException
-
setUp
public BuildWrapper.Environment setUp(AbstractBuild build, Launcher launcher, BuildListener listener) throws IOException, InterruptedException - Overrides:
setUpin classBuildWrapper- Throws:
IOExceptionInterruptedException
-
description
@NonNull public static String description(@NonNull com.cloudbees.plugins.credentials.common.StandardUsernameCredentials c) Helper method that returns a safe description of aStandardUsernameCredentials.- Parameters:
c- the credentials.- Returns:
- the description.
-
SSHAgentBuildWrapper(java.util.List,boolean)