Package jenkins.plugins.git
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
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classGitUsernamePasswordBinding.DescriptorImplprotected static classGitUsernamePasswordBinding.GenerateGitScript-
Nested classes/interfaces inherited from class org.jenkinsci.plugins.credentialsbinding.MultiBinding
org.jenkinsci.plugins.credentialsbinding.MultiBinding.MultiEnvironment, org.jenkinsci.plugins.credentialsbinding.MultiBinding.NullUnbinder, org.jenkinsci.plugins.credentialsbinding.MultiBinding.Unbinder
-
Nested classes/interfaces inherited from interface hudson.ExtensionPoint
ExtensionPoint.LegacyInstancesAreScopedToHudson
-
-
Constructor Summary
Constructors Constructor Description GitUsernamePasswordBinding(String gitToolName, String credentialsId)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description org.jenkinsci.plugins.credentialsbinding.MultiBinding.MultiEnvironmentbind(Run<?,?> run, FilePath filePath, Launcher launcher, TaskListener taskListener)org.jenkinsci.plugins.gitclient.GitClientgetGitClientInstance(String gitToolExe, FilePath repository, EnvVars env, TaskListener listener)Use GitClient to perform git operations in a repository.StringgetGitToolName()voidsetCredentialPairBindings(com.cloudbees.plugins.credentials.common.StandardCredentials credentials, Map<String,String> secretValues, Map<String,String> publicValues)Sets secret or public pair value(s)voidsetGitEnvironmentVariables(org.jenkinsci.plugins.gitclient.GitClient git, Map<String,String> secretValues, Map<String,String> publicValues)Set Git specific environment variableprotected Class<com.cloudbees.plugins.credentials.common.StandardUsernamePasswordCredentials>type()Set<String>variables(Run<?,?> build)-
Methods inherited from class org.jenkinsci.plugins.credentialsbinding.MultiBinding
getCredentials, getCredentialsId, getDescriptor, variables
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface jenkins.plugins.git.GitCredentialBindings
getCliGitTool, isCurrentNodeOSUnix
-
-
-
-
Method Detail
-
getGitToolName
public String getGitToolName()
-
type
protected Class<com.cloudbees.plugins.credentials.common.StandardUsernamePasswordCredentials> type()
- Specified by:
typein classorg.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:
bindin classorg.jenkinsci.plugins.credentialsbinding.MultiBinding<com.cloudbees.plugins.credentials.common.StandardUsernamePasswordCredentials>- Throws:
IOExceptionInterruptedException
-
variables
public Set<String> variables(@NonNull Run<?,?> build)
- Overrides:
variablesin classorg.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:GitCredentialBindingsSets secret or public pair value(s)- Specified by:
setCredentialPairBindingsin interfaceGitCredentialBindings- Parameters:
credentials- The credentialsStandardCredentials. Cannot be nullsecretValues- The valuesMapto be hidden in build logspublicValues- The valuesMapto 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, InterruptedExceptionDescription copied from interface:GitCredentialBindingsSet Git specific environment variable- Specified by:
setGitEnvironmentVariablesin interfaceGitCredentialBindings- Parameters:
git- GitClientGitClient. Cannot be null.secretValues- The valuesMapto be hidden in build logspublicValues- The valuesMapto be visible in build logs- Throws:
IOExceptionInterruptedException
-
getGitClientInstance
public org.jenkinsci.plugins.gitclient.GitClient getGitClientInstance(String gitToolExe, FilePath repository, EnvVars env, TaskListener listener) throws IOException, InterruptedException
Description copied from interface:GitCredentialBindingsUse GitClient to perform git operations in a repository. Using Git implementations JGit/JGit Apache/Cli Git- Specified by:
getGitClientInstancein interfaceGitCredentialBindings- Parameters:
gitToolExe- The pathStringto git executableGit.using(String)repository- The pathStringto working directoryGit.in(File)env- The environment valuesEnvVarslistener- The task listener.- Returns:
- a GitClient implementation
GitClient - Throws:
IOExceptionInterruptedException
-
-