My task is to sping up Jenkins and have Job DSL Seed job automatically created during installation. That means I have to use Configuration as a Code plugin, but this plugin use Job DSL to create jobs, that means I have to create Job DSL job using Job DSL job, did anyone tried this before? Is it nearly possible?
Possible option would be import seed job as XML but this functionality been deprecated in latest Jenkins helm chart.
Yes, it is totally possible.
but this plugin use Job DSL to create jobs- yes, but it assumes, that Job DSL plugin has already been installed.Let me copy a snippet of deployment of Jenkins that I use:
In
plugins.txtthere are, among others, pluginsconfiguration-as-codeandjob-dsl.And
seed-job.yamllooks like this:And now the seed job will automatically import all the jobs from your repository.
An example Job DSL looks like this:
but of course you can write Job DSLs for other types of jobs (e.g. multibranchPipeline). Refer to the API Viewer in your Jenkins instance.