Class SSHCheckoutTrait

  • All Implemented Interfaces:
    Describable<jenkins.scm.api.trait.SCMSourceTrait>

    public class SSHCheckoutTrait
    extends jenkins.scm.api.trait.SCMSourceTrait
    A SCMSourceTrait for GitHubSCMSource that causes the GitSCM checkout to be performed using a SSH private key rather than the GitHub username password credentials used for scanning / indexing.
    Since:
    2.2.0
    • Constructor Detail

      • SSHCheckoutTrait

        @DataBoundConstructor
        public SSHCheckoutTrait​(@CheckForNull
                                String credentialsId)
        Constructor.
        Parameters:
        credentialsId - the IdCredentials.getId() of the credentials to use or GitHubSCMSource.DescriptorImpl.ANONYMOUS to defer to the agent configured credentials (typically anonymous but not always)
    • Method Detail

      • getCredentialsId

        @CheckForNull
        public final String getCredentialsId()
        Returns the configured credentials id.
        Returns:
        the configured credentials id or null to use the build agent's key.
      • decorateBuilder

        protected void decorateBuilder​(jenkins.scm.api.trait.SCMBuilder<?,​?> builder)
        Overrides:
        decorateBuilder in class jenkins.scm.api.trait.SCMSourceTrait