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
Modifier and TypeClassDescriptionstatic final class
protected static final class
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
-
Method Summary
Modifier and TypeMethodDescriptionorg.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.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()
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
-
Constructor Details
-
GitUsernamePasswordBinding
-
-
Method Details
-
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
- 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, throws IOException, InterruptedExceptionString> publicValues) 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
-