I have a Jenkins instance and I am trying to create a continuous integration workflow. I am struggling to get jenkins to get the code onto the production server.
Here is what I'm trying to do:
Permission denied (publickey).
git clone ...
First of all, you should ensure git clone/pull works as intended on production server when launched manually.
Next, debug why doesn't it works driven by Jenkins.
Most likely reasons comes to my mind are:
I had implemented similar logic myself.
In my case production server was configured as Jenkins node, required HOME environment created in job workspace each time, and SSH and git access credentials are configured on Jenkins and populated on production on each run
PS: Using dedicated credentials for production server is absolutely normal (e.g. for security reasons)