diff --git a/jenkins_jobs/modules/builders.py b/jenkins_jobs/modules/builders.py index b84c620eb..970b3aac8 100644 --- a/jenkins_jobs/modules/builders.py +++ b/jenkins_jobs/modules/builders.py @@ -2976,6 +2976,7 @@ def dsl(registry, xml_parent, data): :arg str additional-classpath: 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. (optional) + :arg bool sandbox: Execute script inside of groovy sandbox (default false) Example: @@ -3012,6 +3013,8 @@ def dsl(registry, xml_parent, data): else: raise MissingAttributeError(["script-text", "target"]) + XML.SubElement(dsl, "sandbox").text = str(data.get("sandbox", "false")).lower() + XML.SubElement(dsl, "ignoreExisting").text = str( data.get("ignore-existing", False) ).lower() diff --git a/tests/builders/fixtures/dsl-002.xml b/tests/builders/fixtures/dsl-002.xml index 555073e4b..fb6df56cc 100644 --- a/tests/builders/fixtures/dsl-002.xml +++ b/tests/builders/fixtures/dsl-002.xml @@ -4,6 +4,7 @@ jobs/*/*/*.groovy false + false true IGNORE IGNORE diff --git a/tests/builders/fixtures/dsl001.xml b/tests/builders/fixtures/dsl001.xml index 1c04301ac..26b743d71 100644 --- a/tests/builders/fixtures/dsl001.xml +++ b/tests/builders/fixtures/dsl001.xml @@ -4,6 +4,7 @@ job { name 'dsljob' } true + true true DISABLE DELETE diff --git a/tests/builders/fixtures/dsl001.yaml b/tests/builders/fixtures/dsl001.yaml index 9809c16f7..05f6fc5ba 100644 --- a/tests/builders/fixtures/dsl001.yaml +++ b/tests/builders/fixtures/dsl001.yaml @@ -6,3 +6,4 @@ builders: removed-view-action: "DELETE" lookup-strategy: "SEED_JOB" additional-classpath: "*.jar" + sandbox: "true" diff --git a/tests/builders/fixtures/dsl002.xml b/tests/builders/fixtures/dsl002.xml index b4a97d87c..2938d7cc3 100644 --- a/tests/builders/fixtures/dsl002.xml +++ b/tests/builders/fixtures/dsl002.xml @@ -4,6 +4,7 @@ jobs/**/*.groovy false + false true DISABLE DELETE