I am writing job-dsl seed work. The seed task should be able to generate either from github.com or from my corporate github servers. I would like to keep one job, not two.
In each case, I would like jenkins to be authenticated. To do this, I hard-coded creds into a script. However, I am not happy with this. I would prefer to add the Credentials parameter to the seed job.
The problem is that the Creds parameter adds en ENV variable to the script that contains USERID / PASSWORD. http://steve-jansen.imtqy.com/blog/2014/12/16/parsing-jenkins-secrets-in-a-shell-script/
However, git jobdsl requires a credential identifier, not USERID / PASSWORD.
How to resolve this deadlock?
scm {
git {
remote {
name('origin')
url(repo)
credentials(myCredential)
}
branch('master')
}
}