Class SSHAgentBuildWrapper
- java.lang.Object
-
- hudson.model.AbstractDescribableImpl<BuildWrapper>
-
- hudson.tasks.BuildWrapper
-
- com.cloudbees.jenkins.plugins.sshagent.SSHAgentBuildWrapper
-
- All Implemented Interfaces:
ExtensionPoint
,Describable<BuildWrapper>
public class SSHAgentBuildWrapper extends BuildWrapper
A build wrapper that provides an SSH agent using supplied credentials
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
SSHAgentBuildWrapper.CredentialHolder
A value object to make it possible to pass back multiple credentials via the UI.static class
SSHAgentBuildWrapper.DescriptorImpl
Our descriptor.-
Nested classes/interfaces inherited from class hudson.tasks.BuildWrapper
BuildWrapper.Environment
-
Nested classes/interfaces inherited from interface hudson.ExtensionPoint
ExtensionPoint.LegacyInstancesAreScopedToHudson
-
-
Constructor Summary
Constructors Constructor Description SSHAgentBuildWrapper(SSHAgentBuildWrapper.CredentialHolder[] credentialHolders, boolean ignoreMissing)
Constructs a new instance.SSHAgentBuildWrapper(String user)
Deprecated.SSHAgentBuildWrapper(List<String> credentialIds, boolean ignoreMissing)
Constructs a new instance.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description static String
description(com.cloudbees.plugins.credentials.common.StandardUsernameCredentials c)
Helper method that returns a safe description of aStandardUsernameCredentials
.SSHAgentBuildWrapper.CredentialHolder[]
getCredentialHolders()
Returns the value objects used to hold the credential ids.List<String>
getCredentialIds()
Gets theIdCredentials.getId()
s of the credentials to use.String
getUser()
Deprecated.boolean
isIgnoreMissing()
Whentrue
then any missing credentials will be ignored.void
preCheckout(AbstractBuild build, Launcher launcher, BuildListener listener)
BuildWrapper.Environment
setUp(AbstractBuild build, Launcher launcher, BuildListener listener)
-
Methods inherited from class hudson.tasks.BuildWrapper
all, decorateLauncher, decorateLogger, getProjectAction, getProjectActions, makeBuildVariables, makeSensitiveBuildVariables, setUp
-
Methods inherited from class hudson.model.AbstractDescribableImpl
getDescriptor
-
-
-
-
Constructor Detail
-
SSHAgentBuildWrapper
@Deprecated public SSHAgentBuildWrapper(String user)
Deprecated.Constructs a new instance.- Parameters:
user
- theIdCredentials.getId()
of the credentials to use.
-
SSHAgentBuildWrapper
@DataBoundConstructor public SSHAgentBuildWrapper(SSHAgentBuildWrapper.CredentialHolder[] credentialHolders, boolean ignoreMissing)
Constructs a new instance.- Parameters:
credentialHolders
- theSSHAgentBuildWrapper.CredentialHolder
s of the credentials to use.ignoreMissing
-true
missing credentials will not cause a build failure.- Since:
- 1.5
-
-
Method Detail
-
getUser
@Deprecated public String getUser()
Deprecated.Gets theIdCredentials.getId()
of the credentials to use.- Returns:
- the
IdCredentials.getId()
of the credentials to use.
-
getCredentialIds
public List<String> getCredentialIds()
Gets theIdCredentials.getId()
s of the credentials to use.- Returns:
- the
IdCredentials.getId()
s of the credentials to use. - Since:
- 1.5
-
isIgnoreMissing
public boolean isIgnoreMissing()
Whentrue
then any missing credentials will be ignored. Whenfalse
then the build will be failed if any of the required credentials cannot be resolved.- Returns:
true
missing credentials will not cause a build failure.
-
getCredentialHolders
public SSHAgentBuildWrapper.CredentialHolder[] 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:
preCheckout
in classBuildWrapper
- Throws:
IOException
InterruptedException
-
setUp
public BuildWrapper.Environment setUp(AbstractBuild build, Launcher launcher, BuildListener listener) throws IOException, InterruptedException
- Overrides:
setUp
in classBuildWrapper
- Throws:
IOException
InterruptedException
-
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.
-
-