I need to copy artifacts from a specific build which is not always the latest. I'm searching for a way to copy the artifacts from a specfic build number.
Does anybody know if it is possible and how i can do that?
I use the following snippet in my pipeline script to copy the latest artifacts:
step ([
$class: 'CopyArtifact',
projectName: "myproject",
filter: '_build/*.zip'
]);
How to Create an Artifact. In Jenkins, an artifact is created in either Freestyle projects or Pipeline projects. In Freestyle, add the “Archive the artifacts” post-build step. In Pipeline, use the archiveArtifacts step.
Take a look in the tests of the plugin, there is an example of how to configure a specific selector. If I try to extract it, it would look like:
step([$class: 'CopyArtifact',
projectName: "myproject",
filter: '_build/*.zip'
selector:
[$class: 'SpecificBuildSelector',
buildNumber: "123"]
])
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With