In my Jenkins job, I am configuring git in the following way:
sh(\"git config user.email my.email@google.com\")
sh(\"git config user.name my-user-name\")
sh(
You're looking for credential.username. I don't know about the passphrase, but if you dislike http://username:password@my-git-repo.com:8000
then put the credentials in your Jenkinsfile like so:
The second most common type of Credentials is "Username and Password" which can still be used in the
environment
directive, but results in slightly different variables being set.environment { SAUCE_ACCESS = credentials('sauce-lab-dev') }
This will actually set 3 environment variables:
SAUCE_ACCESS containing <username>:<password> SAUCE_ACCESS_USR containing the username SAUCE_ACCESS_PSW containing the password
credentials
is only available for Declarative Pipeline. For those using Scripted Pipeline, see the documentation for thewithCredentials
step.