-
Bug
-
Resolution: Unresolved
-
Major
-
None
When using the Job DSL plugin to script the definition of a job, it is currently not possible to add a generic Artifactory publisher which uses an inline spec script. From what I can tell the underlying problem is that both filePath and spec parameters are both mandatory when defining the uploadSpec DSL block, and when the former is defined - even if it is defined with an empty string - the latter parameter is ignored. However since both are mandatory parameters you can't omit the one you don't want.
So, for example, the flowing DSL snippet shows how the upload spec must be defined due to the mandatory parameters:
artifactoryGenericConfigurator { ..... // other config options here, too verbose to mention uploadSpec { filePath('') spec('{ "files": [ { "patern": "*.gz", "target": "repo/path"}]}') } }
However, since the filePath property is defined it takes precidence over the spec property. Omitting the filePath property triggers a DSL parsing error something like this:
ERROR: (script, line 72) the following options are required and must be specified: filePath
Other than using manual configure blocks to generate the job XML directly I haven't found any way to circumvent this problem.
- relates to
-
JENKINS-45156 Set sensible defaults for artifactory plugin in job DSL
-
- Open
-