Initializing Jenkins 2.0 with pipeline in init.groovy.d script
<p>For automation, I would like to initialize a Jenkins 2.0 instance with a pipeline job. I want to create a Groovy script that is copied to the <code>/usr/share/jenkins/ref/init.groovy.d/</code> folder on startup. The script should create a Jenkins 2.0 Pipeline job for processing a Jenkinsfile from SCM.</p>

<p>I cannot find the relevant Javadoc for the 2.0 pipeline classes or examples of how to do this.</p>

<p>Previously, using Job DSL to create a pipeline, I used a Groovy script to create a <code>FreeStyleProject</code> with an <code>ExecuteDslScripts</code> builder. That job would then be the Job DSL seed job.</p>

<p>One option is to use an init script to create a Job DSL seed job to create a Jenkins 2.0 pipeline. It just seems unnecessarily complex.</p>

<p>I am experimenting in this repo: <a href="https://github.com/martinmosegaard/vigilant-sniffle" rel="nofollow">https://github.com/martinmosegaard/vigilant-sniffle</a></p>