6

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'
    ]);

1 Answer 1

8

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"]
     ])
3
  • 1
    Is it possible to add multiple selectors? For example, besides the SpecificBuildSelector I'd like to include the StatusBuildSelector. Commented Mar 23, 2017 at 8:45
  • Not sure, I suppose you could download the repo and experioment with some unit tests Commented Mar 23, 2017 at 10:43
  • Add as separate question in SO? Commented Mar 23, 2017 at 10:44

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.