Hi,
while trying to setup a copyArtifacts action inside a promotion, using the following definition
actions {
copyArtifacts('${PROMOTED_
JOB_NAME
}') {
buildSelector {
specific { buildNumber('${PROMOTED_NUMBER}') }
}
flatten(false)
includePatterns('moveBinaries.properties')
optional(false)
targetDirectory('${PROMOTED_NUMBER}')
}
}
I got an error when running the seed job:
ERROR: Found multiple extensions which provide method specific with arguments [JobDSL.TheJob$_build_closure1$_closure4$_closure10$_closure11$_closure13$_closure14$_closure17$_closure18@37fe6593]: [[com.tikal.jenkins.plugins.multijob.MultiJobBuildSelector, hudson.plugins.copyartifact.SpecificBuildSelector]]
So the “specific” build selector produces a method name clash with MultiJobBuildSelector. I therefor tried to add the build selector by using a configure block as follows:
actions {
copyArtifacts('${PROMOTED_
JOB_NAME
}') {
configure { node ->
node / 'selector' << 'hudson.plugins.copyartifact.SpecificBuildSelector' {
buildNumber('${PROMOTED_NUMBER}')
}
}
flatten(false)
includePatterns('moveBinaries.properties')
optional(false)
targetDirectory('${PROMOTED_NUMBER}')
}
}
This time the seed job didn’t fail, but the generated job had an empty StatusBuildSelector defined, like so:
<selector class="hudson.plugins.copyartifact.StatusBuildSelector"/>
Any idea what could be wrong here and how I can get the specific build selector into the job config?
Thanks…
Dirk
--
Dirk Heinrichs
Senior Systems Engineer, Delivery Pipeline
OpenText ™ Discovery | Recommind
Email: dhei...@opentext.com
Website: www.recommind.de
Recommind GmbH, Von-Liebig-Straße 1, 53359 Rheinbach
Vertretungsberechtigte Geschäftsführer John Marshall Doolittle, Gordon Davies, Roger Illing, Registergericht Amtsgericht Bonn, Registernummer HRB 10646
This e-mail may contain confidential and/or privileged information. If you are not the intended recipient (or have received this e-mail in error) please notify the sender immediately and destroy this e-mail. Any unauthorized copying, disclosure or distribution of the material in this e-mail is strictly forbidden
Diese E-Mail enthält vertrauliche und/oder rechtlich geschützte Informationen. Wenn Sie nicht der richtige Adressat sind oder diese E-Mail irrtümlich erhalten haben, informieren Sie bitte sofort den Absender und vernichten Sie diese Mail. Das unerlaubte Kopieren sowie die unbefugte Weitergabe dieser Mail sind nicht gestattet.
freeStyleJob('test-job') { properties{ promotions { promotion { ...
actions { copyArtifacts('upstream') { ... buildSelector { buildNumber('${PROMOTED_NUMBER}') } } } } } }}
Hi,
thanks for quick reply.
> the `specific` block is not part of the DSL definition of `copyArtifacts` as far as I see, but you could use any of the below DSLs:
> - <YOUR_JENKINS_URL>/plugin/job-dsl/api-viewer/index.html#path/javaposse.jobdsl.dsl.helpers.step.StepContext.copyArtifacts-buildSelector-specificBuildSelector
Well, I use the JobDSL API documentation as provided by our Jenkins server itself, and that one looks a bit different (comments removed):
copyArtifacts(String jobName) {
buildSelector {
buildNumber(int buildNumber)
buildNumber(String buildNumber)
…
specific {
buildNumber(String value)
}
…
}
…
}
However, I didn’t spot the first two buildNumber() methods at the top right away, but only the “specific” block. Using it as you suggested indeed fixed the problem.
Thanks a lot.
Bye…
Dirk
--
You received this message because you are subscribed to the Google Groups "Jenkins Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to
jenkinsci-use...@googlegroups.com.
To view this discussion on the web visit
https://groups.google.com/d/msgid/jenkinsci-users/e19d957a-6fe7-42ec-8523-7e747445efae%40googlegroups.com.
For more options, visit
https://groups.google.com/d/optout.