chitra
chitra

Reputation: 89

Not able to push changes to git repository using Jenkins

I have created Jenkins pipeline for building code by cloning from git. I am able to clone repo , after building I want to push some files to git repo. I gave git credentials in Jenkins, still I am getting below error while pushing code.

fatal: could not read Username for 'https://bitbucket.xyz.com': No such device or address

I have seen many answers in google and tried that did not help me. Any ideas how we can solve this problem?

Upvotes: 1

Views: 815

Answers (1)

VonC
VonC

Reputation: 1323903

See if you can follow Handling credentials / Usernames and passwords and use environment variables.

Jenkins' declarative Pipeline syntax has the credentials() helper method (used within the environment directive) which supports secret text, username and password, as well as secret file credentials

You can see a concrete example here.

Upvotes: 1

Related Questions