0

I have Job DSL in a Github Enterprise repo. I want to use that Job DSL to create jobs on Jenkins startup. I already have git repo credentials created using JCasC, pulling from AWS SSM. Once I have the Job DSL, I will use the DslScriptLoader function to parse.

How do I use Groovy to git clone that repo to /tmp during the init.groovy.d post init stage, using credentials Jenkins already knows?

Cory Ringdahl
  • 522
  • 5
  • 12
  • What is your **specific** question? A [mre] showing what you have tried that did not work would maximize your chances of getting help. See _[ask]_. – hakre Apr 11 '23 at 15:36
  • Please help me clarify this question if it's not clear enough. I've provided use case and need. – Cory Ringdahl Apr 11 '23 at 15:37
  • Sure, we don't have your deployment script to setup the use-case environment. therefore it is often helping if your question contains some code, even if it is pseudo code. In your case, I guess at least some groovy code should be available for display. /Edit: It is also very useful when you show what you have tried so far, even if it doesn't work. – hakre Apr 11 '23 at 15:42
  • I don't have any groovy code. I've looked around for a solution for the past several days and have found no one doing what I'm doing. My knowledge of groovy is almost nil, and I don't know where to start, thus my question. – Cory Ringdahl Apr 11 '23 at 15:45
  • Yes, I can understand that, but please mind for a Q&A platform that easily falls into the gap between groovy knowledge (and asking about groovy) and the git knowledge within Jenkins init stage (?). Maybe someone who is really clever get what you mean on spot, but then it may be much later and you could have already clarified on how to call git on init (and if it is only showing status or cloning that fails) - lets say - so you could have verified credentials are the problem or first of all how to hook at the proper stage. You ask about your specif. concrete problem, not the full requirements. – hakre Apr 11 '23 at 15:48
  • The full requirements are spelled out w/r/t having Job DSL in a git repo, when I want that DSL available (Jenkins startup), and what I need it for (creating jobs at startup). I am in fact hoping that someone who is really clever will be the one that reads and answers this. – Cory Ringdahl Apr 11 '23 at 15:59
  • Sure, but just a last comment on that: Not everyone loves it when you only drop requirements and nothing else. Often the opposite is true, you may even see down- and close votes. IMHO there are no wrong questions, perhaps some that are out of scope of the site. Just FYI. – hakre Apr 11 '23 at 16:24

0 Answers0