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
  • Constructor Details

    • SSHAgentBuildWrapper

      @Deprecated public SSHAgentBuildWrapper(String user)
      Constructs a new instance.
      Parameters:
      user - the IdCredentials.getId() of the credentials to use.
    • SSHAgentBuildWrapper

      public SSHAgentBuildWrapper(SSHAgentBuildWrapper.CredentialHolder[] credentialHolders, boolean ignoreMissing)
    • SSHAgentBuildWrapper

      @Deprecated public SSHAgentBuildWrapper(List<String> credentialIds, boolean ignoreMissing)
      Deprecated.
    • SSHAgentBuildWrapper

      @DataBoundConstructor public SSHAgentBuildWrapper(SSHAgentBuildWrapper.CredentialHolder[] credentialHolders, boolean ignoreMissing, int timeout)
      Constructs a new instance.
      Parameters:
      credentialHolders - the SSHAgentBuildWrapper.CredentialHolders of the credentials to use.
      ignoreMissing - true missing credentials will not cause a build failure.
      timeout - The timeout (in minutes) for ssh agent commands.
      Since:
      FIXME
    • SSHAgentBuildWrapper

      public SSHAgentBuildWrapper(List<String> credentialIds, boolean ignoreMissing, int timeout)
      Constructs a new instance.
      Parameters:
      credentialIds - the IdCredentials.getId()s of the credentials to use.
      ignoreMissing - true missing credentials will not cause a build failure.
      timeout - The timeout (in minutes) for ssh agent commands.
      Since:
      FIXME
  • Method Details

    • getUser

      @Deprecated public String getUser()
      Deprecated.
      Gets the IdCredentials.getId() of the credentials to use.
      Returns:
      the IdCredentials.getId() of the credentials to use.
    • getCredentialIds

      public List<String> getCredentialIds()
      Gets the IdCredentials.getId()s of the credentials to use.
      Returns:
      the IdCredentials.getId()s of the credentials to use.
      Since:
      1.5
    • isIgnoreMissing

      public boolean isIgnoreMissing()
      When true then any missing credentials will be ignored. When false 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.
    • getTimeout

      public int getTimeout()
      The timeout (in minutes) for ssh agent commands.
      Returns:
      the startup timeout in minutes.
      Since:
      FIXME
    • 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 class BuildWrapper
      Throws:
      IOException
      InterruptedException
    • setUp

      Overrides:
      setUp in class BuildWrapper
      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 a StandardUsernameCredentials.
      Parameters:
      c - the credentials.
      Returns:
      the description.