I am setting up jenkins build pipeline and in one of the build steps, I am trying to git clone a repository.
Build steps(execute shell):
git clone [email protected]:orgname/reponame.git
It fails at this step with
10:14:01 Permission denied (publickey).
10:14:01 fatal: The remote end hung up unexpectedly
10:14:01 Build step 'Execute shell' marked build as failure
10:14:01 Finished: FAILURE
However, while setting up the repo, I have set scm as git and have specified the repository url as git clone [email protected]:orgname/reponame.git and this works perfectly.
Any idea what I might be missing here.
su - jenkinsas superuser.