The following plugin provides functionality available through Pipeline-compatible steps. Read more about how to integrate steps into your Pipeline in the Steps section of the Pipeline Syntax page.

For a list of other such plugins, see the Pipeline Steps Reference page.

Table of Contents

Job DSL

jobDsl: Process Job DSLs

  • additionalClasspath : String (optional)
    Newline separated list of additional classpath entries for the Job DSL scripts. All entries must be relative to the workspace root, e.g. build/classes/main. Supports Ant-style patterns like lib/*.jar.
  • additionalParameters (optional)
    • Type: java.util.Map<java.lang.String, java.lang.Object>
  • failOnMissingPlugin : boolean (optional)
    If checked, the build will be marked as failed if a plugin must be installed or updated to support all features used in the DSL scripts. If not checked, the build will be marked as unstable instead.
  • failOnSeedCollision : boolean (optional)
    Fail build if generated item(s) have the same name as existing items already managed by another seed job. By default, this plugin will always regenerate all jobs and views, thus updating previously generated jobs and views even if managed by another seed job. Check this box if you wish to fail the job if a generated item name collision is detected.
  • ignoreExisting : boolean (optional)
    Ignore previously generated jobs and views. By default, this plugin will always regenerate all jobs and views, thus updating previously generated jobs and views. Check this box if you wish to leave previous jobs and views as is.
  • ignoreMissingFiles : boolean (optional)
    Ignore missing DSL scripts. If not checked, the build step will fail if a configured script is missing or if a wildcard does not match any files.
  • lookupStrategy (optional)
    Determines how relative job names in DSL scripts are interpreted. You will only see a difference when the seed job is located in a folder.
    • Jenkins Root When this option is selected relative job names are always interpreted relative to the Jenkins root.
    • Seed Job If you choose this option relative job names in DSL scripts will be interpreted relative to the folder in which the seed job is located. Suppose you have a seed job which is located in a folder named seedJobFolder and a DSL script which creates a job named subfolder2/job. The job that is created by the seed job will be at the location /seedJobFolder/subfolder2/job.
    • Values: JENKINS_ROOT, SEED_JOB
  • removedConfigFilesAction (optional)
    Specifies what to do when previously generated config files are not referenced anymore.

    Note: when using multiple Job DSL build steps in a single job, set this to "Delete" only for the last Job DSL build step. Otherwise config files may be deleted and re-created. See JENKINS-44142 for details.

    • Values: IGNORE, DELETE
  • removedJobAction (optional)
    Specifies what to do when a previously generated job is not referenced anymore.

    Note: when using multiple Job DSL build steps in a single job, set this to "Delete" or "Disable" only for the last Job DSL build step. Otherwise jobs will be deleted and re-created or disabled and re-enabled and you may lose the job history of generated jobs. See JENKINS-44142 for details.

    • Values: IGNORE, DISABLE, DELETE
  • removedViewAction (optional)
    Specifies what to do when a previously generated view is not referenced anymore.

    Note: when using multiple Job DSL build steps in a single job, set this to "Delete" only for the last Job DSL build step. Otherwise views may be deleted and re-created. See JENKINS-44142 for details.

    • Values: IGNORE, DELETE
  • sandbox : boolean (optional)
    If checked, runs the DSL scripts in a sandbox with limited abilities. You will also need to configure this job to run with the identity of a particular user. If unchecked, and you are not a Jenkins administrator, you will need to wait for an administrator to approve the scripts.
  • scriptText : String (optional)
    DSL Script, which is groovy code. Look at documentation for details on the syntax.
  • targets : String (optional)
    Newline separated list of DSL scripts, located in the Workspace. Can use wildcards like 'jobs/**/*.groovy'. See the @includes of Ant fileset for the exact format.

    Scripts are executed in the same order as specified. The execution order of expanded wildcards is unspecified.

  • unstableOnDeprecation : boolean (optional)
    If checked, marks the build as unstable when using deprecated features. If not checked, a warning will be printed to the build log only.
  • useScriptText : boolean (optional)

Was this page helpful?

Please submit your feedback about this page through this quick form.

Alternatively, if you don't wish to complete the quick form, you can simply indicate if you found this page helpful?

    


See existing feedback here.