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 class
GitUsernamePasswordBinding.DescriptorImpl
protected static class
GitUsernamePasswordBinding.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.MultiEnvironment
bind(Run<?,?> run, FilePath filePath, Launcher launcher, TaskListener taskListener)
org.jenkinsci.plugins.gitclient.GitClient
getGitClientInstance(String gitToolExe, FilePath repository, EnvVars env, TaskListener listener)
Use GitClient to perform git operations in a repository.String
getGitToolName()
void
setCredentialPairBindings(com.cloudbees.plugins.credentials.common.StandardCredentials credentials, Map<String,String> secretValues, Map<String,String> publicValues)
Sets secret or public pair value(s)void
setGitEnvironmentVariables(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:
type
in 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:
bind
in classorg.jenkinsci.plugins.credentialsbinding.MultiBinding<com.cloudbees.plugins.credentials.common.StandardUsernamePasswordCredentials>
- Throws:
IOException
InterruptedException
-
variables
public Set<String> variables(@NonNull Run<?,?> build)
- Overrides:
variables
in 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:GitCredentialBindings
Sets secret or public pair value(s)- Specified by:
setCredentialPairBindings
in interfaceGitCredentialBindings
- Parameters:
credentials
- The credentialsStandardCredentials
. Cannot be nullsecretValues
- The valuesMap
to be hidden in build logspublicValues
- 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 interfaceGitCredentialBindings
- Parameters:
git
- GitClientGitClient
. Cannot be null.secretValues
- The valuesMap
to be hidden in build logspublicValues
- 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 interfaceGitCredentialBindings
- Parameters:
gitToolExe
- The pathString
to git executableGit.using(String)
repository
- The pathString
to working directoryGit.in(File)
env
- The environment valuesEnvVars
listener
- The task listener.- Returns:
- a GitClient implementation
GitClient
- Throws:
IOException
InterruptedException
-
-