This is an example project to create jenkins pipelines (script and scm) with the help of Jenkins Job DSL plugin.
Jenkins Configuration as Code plugin is able to finish most Jenkins configuration as code, but not jobs creation. Together with Job DSL plugin, Jenkins as Code
can be achieved. An example of these two plugins working together can be found here.
Under root directory, there is a Maven 'hello world' project. In directory jobs
, you will find 2 jobs definition to build this Maven project.
-
pipeline-scm.groovy
Jenkins pipeline through Jenkinsfile defined in a git SCM.
-
pipeline-script.groovy
Jenkins pipeline through build script inline.
-
github-organization.groovy
A github organization job based on github branch source plugin. This job will scan all repositories under a github organization/personal account, and create jenkins multibranch pipeline projects if a 'Jenkinsfile' is present in the repository.