I am trying to find an example of using the Jenkins Copy Artifacts Plugin from within Jenkins pipelines (workflows).
Can anyone point to a sample Groovy code that is using it?
I am trying to find an example of using the Jenkins Copy Artifacts Plugin from within Jenkins pipelines (workflows).
Can anyone point to a sample Groovy code that is using it?
If you are using slaves in your master and you want to copy artifacts between each other you can use stash/unstash, for example:
You can see this example in this link:
https://dzone.com/refcardz/continuous-delivery-with-jenkins-workflow
If builds are not running in the same pipeline you can use direct
CopyArtifact
plugin, here is example: https://www.cloudbees.com/blog/copying-artifacts-between-builds-jenkins-workflow and example code:try that using copy artifact plugin
With a declarative Jenkinsfile, you can use following pipeline:
With
CopyArtifact
, I use '${JOB_NAME}' as project name which is the current running project.Default selector used by
CopyArtifact
use last successful project build number, never current one (because it's not yet successful, or not). WithSpecificBuildSelector
you can choose '${BUILD_NUMBER}' which contains current running project build number.This pipeline works with parallel stages and can manage huge files (I'm using a 300Mb file, it not works with stash/unstash)