How can I use the Jenkins Copy Artifacts Plugin from within the pipelines (jenkinsfile)?

后端 未结 4 2136
醉酒成梦
醉酒成梦 2020-12-01 11:36

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

4条回答
  •  清歌不尽
    2020-12-01 12:35

    If you are using slaves in your master and you want to copy artifacts between each other you can use stash/unstash, for example:

    stage 'build'
    node{
       git 'https://github.com/cloudbees/todo-api.git'
       stash includes: 'pom.xml', name: 'pom'
    }
    
    stage name: 'test', concurrency: 3
    node {
       unstash 'pom'
       sh 'cat pom.xml' 
    }
    

    You can see this example in this link:

    https://dzone.com/refcardz/continuous-delivery-with-jenkins-workflow

提交回复
热议问题