Class GitUsernamePasswordBinding

java.lang.Object
hudson.model.AbstractDescribableImpl<org.jenkinsci.plugins.credentialsbinding.MultiBinding<C>>
org.jenkinsci.plugins.credentialsbinding.MultiBinding<com.cloudbees.plugins.credentials.common.StandardUsernamePasswordCredentials>
jenkins.plugins.git.GitUsernamePasswordBinding
All Implemented Interfaces:
ExtensionPoint, Describable<org.jenkinsci.plugins.credentialsbinding.MultiBinding<com.cloudbees.plugins.credentials.common.StandardUsernamePasswordCredentials>>, GitCredentialBindings

public class GitUsernamePasswordBinding extends org.jenkinsci.plugins.credentialsbinding.MultiBinding<com.cloudbees.plugins.credentials.common.StandardUsernamePasswordCredentials> implements GitCredentialBindings
  • Constructor Details

    • GitUsernamePasswordBinding

      @DataBoundConstructor public GitUsernamePasswordBinding(String gitToolName, String credentialsId)
  • Method Details

    • getGitToolName

      public String getGitToolName()
    • type

      protected Class<com.cloudbees.plugins.credentials.common.StandardUsernamePasswordCredentials> type()
      Specified by:
      type in class org.jenkinsci.plugins.credentialsbinding.MultiBinding<com.cloudbees.plugins.credentials.common.StandardUsernamePasswordCredentials>
    • bind

      public org.jenkinsci.plugins.credentialsbinding.MultiBinding.MultiEnvironment bind(@NonNull Run<?,?> run, FilePath filePath, Launcher launcher, @NonNull TaskListener taskListener) throws IOException, InterruptedException
      Specified by:
      bind in class org.jenkinsci.plugins.credentialsbinding.MultiBinding<com.cloudbees.plugins.credentials.common.StandardUsernamePasswordCredentials>
      Throws:
      IOException
      InterruptedException
    • variables

      public Set<String> variables(@NonNull Run<?,?> build)
      Overrides:
      variables in class org.jenkinsci.plugins.credentialsbinding.MultiBinding<com.cloudbees.plugins.credentials.common.StandardUsernamePasswordCredentials>
    • setCredentialPairBindings

      public void setCredentialPairBindings(@NonNull com.cloudbees.plugins.credentials.common.StandardCredentials credentials, Map<String,String> secretValues, Map<String,String> publicValues)
      Description copied from interface: GitCredentialBindings
      Sets secret or public pair value(s)
      Specified by:
      setCredentialPairBindings in interface GitCredentialBindings
      Parameters:
      credentials - The credentials StandardCredentials. Cannot be null
      secretValues - The valuesMap to be hidden in build logs
      publicValues - The valuesMap to be visible in build logs
    • setGitEnvironmentVariables

      public void setGitEnvironmentVariables(@NonNull org.jenkinsci.plugins.gitclient.GitClient git, Map<String,String> secretValues, Map<String,String> publicValues) throws IOException, InterruptedException
      Description copied from interface: GitCredentialBindings
      Set Git specific environment variable
      Specified by:
      setGitEnvironmentVariables in interface GitCredentialBindings
      Parameters:
      git - GitClient GitClient. Cannot be null.
      secretValues - The valuesMap to be hidden in build logs
      publicValues - The valuesMap to be visible in build logs
      Throws:
      IOException
      InterruptedException
    • getGitClientInstance

      public org.jenkinsci.plugins.gitclient.GitClient getGitClientInstance(String gitToolExe, FilePath repository, EnvVars env, TaskListener listener) throws IOException, InterruptedException
      Description copied from interface: GitCredentialBindings
      Use GitClient to perform git operations in a repository. Using Git implementations JGit/JGit Apache/Cli Git
      Specified by:
      getGitClientInstance in interface GitCredentialBindings
      Parameters:
      gitToolExe - The path String to git executable Git.using(String)
      repository - The path String to working directory Git.in(File)
      env - The environment values EnvVars
      listener - The task listener.
      Returns:
      a GitClient implementation GitClient
      Throws:
      IOException
      InterruptedException