git credentials are missing after copying the jobs

31 views
Skip to first unread message

Jirong Hu

unread,
Oct 21, 2015, 9:58:50 AM10/21/15
to Jenkins Users
We just did a copy (of the job directories) from DEV server to PROD server, but found all git credentials are missing in jobs in the target server. Any idea why and how to fix it? We copied about 50 jobs.

Thanks
Jirong

Mark Waite

unread,
Oct 21, 2015, 11:29:22 AM10/21/15
to Jenkins Users
I believe credentials are assigned an identifier at the time the credential is created in Jenkins, then that identifier is used in the job definition.  That makes the credential definition specific to the Jenkins instance where the credential was created.

You might attempt to copy the credentials from the file system of the source Jenkins server to the file system of the target Jenkins server.  That might preserve the credential identifier into the target Jenkins server.

I've not yet learned a highly effective way to extract jobs which use credentials on one machine and then define those same jobs using the Jenkins CLI or other calls on another machine.  Maybe others have learned a good technique and are willing to share it with us.

Mark Waite

--
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 jenkinsci-use...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/jenkinsci-users/127f4b45-a69e-4abf-a87c-bc5722d24056%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

milki milk

unread,
Oct 21, 2015, 12:41:38 PM10/21/15
to Jenkins Users
With the SSH Credentials Plugin 1.11, you can now specify your own identifier for credentials - https://wiki.jenkins-ci.org/display/JENKINS/SSH+Credentials+Plugin (click Advanced when you create *new* credentials).

If you use the same id across your jenkins instances, then the copied job definitions will still have valid configured credentials.
Reply all
Reply to author
Forward
0 new messages