/jenkins-job-builder-pipeline

Pipeline support for jenkins-job-builder

Primary LanguagePythonApache License 2.0Apache-2.0

jenkins-job-builder-pipeline

A plugin for jenkins-job-builder to support pipeline job generation.

Build Status: Build Status

Usage:

Plugin adds a new project-type pipeline and a job definition field pipeline. There are two distinct job definitions.

Create a pipeline job with a DSL script:

- job:
    name: example-script
    project-type: pipeline
    pipeline:
      script: |
        # Your dsl script goes here.
        node {
          echo 'Hello world'
        }
      sandbox: true # Use groovy sandbox, false by default.

Create a pipeline job loading pipeline script from SCM.

- job:
    name: example-scm-script
    project-type: pipeline
    pipeline:
      script-path: subdir/Jenkinsfile # path to pipeline script definition, "Jenkinsfile" by default.
      scm: # normal scm definitions
        - git:
            branches:
              - '*/maser'
            url: 'git@github.com:github-username/repository-name.git'
            basedir: 'subdir'
            skip-tag: true
            wipe-workspace: false

Definition type is chosen automatically by detecting presence of "scm" field.