If you're cloning with http or https protocol, then you may be able to write the URL as:
https://username:password@hostname/path/to/repo.git Replace username with the evaluated value of GIT_USERNAME and replace password with the evaluated value of GIT_PASSWORD. If you're cloning with ssh protocol, then you need a private key / public key pair, not GIT_PASSWORD. The GIT_USERNAME and GIT_PASSWORD environment variables are not read by the git plugin or the git client plugin as far as I can tell. Thus, I assume your jobs were expanding their values and using them in the authentication steps. They could also have been used as input to a git credential helper, though that would need to be configured on every agent in the home directory of the user running the agent. I recommend against that technique because it increases the work you must do to maintain your agents. While those are my guesses, my recommendation is that you switch to use the Jenkins credentials system to record your git user name and password inside Jenkins, then modify your job definition to use those recorded credentials. That avoids displaying username and password in job logs, and significantly reduces the risk of someone misusing your username/password combination. Mark WAite On Sun, May 28, 2017 at 11:46 PM Adi Lavi <[email protected]> wrote: > hello, > I am trying to debug an issue with JenkinsFIle using git credentials. It > uses the variables GIT_USERNAME and GIT_PASSWORD which seem to be wrong, as > the log shows that git commands fail to connect (used to work before, but > users have changed). > > How can I find where and how these variables are set, so I can fix them? > > Thanks > > -- > You received this message because you are subscribed to the Google Groups > "Jenkins Users" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to [email protected]. > To view this discussion on the web visit > https://groups.google.com/d/msgid/jenkinsci-users/5d5cc159-dae1-4a4f-b45f-9595f5b0e973%40googlegroups.com > <https://groups.google.com/d/msgid/jenkinsci-users/5d5cc159-dae1-4a4f-b45f-9595f5b0e973%40googlegroups.com?utm_medium=email&utm_source=footer> > . > For more options, visit https://groups.google.com/d/optout. > -- You received this message because you are subscribed to the Google Groups "Jenkins Users" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To view this discussion on the web visit https://groups.google.com/d/msgid/jenkinsci-users/CAO49JtEn6Y9Xerf9DX9E52%3DwAuaiKZk8nMh5_rxfnLSGZvHCpA%40mail.gmail.com. For more options, visit https://groups.google.com/d/optout.
