You can caputre the node name in the first time you use the node and then 
specify it as the node label in the following node steps. 

On Monday, October 23, 2017 at 2:44:37 PM UTC-6, Torsten Reinhard wrote:
>
> Hi, 
>
> I have a large build & deploy pipeline with some stages, running on 
> different nodes. I´m using stash/unstash for transfering the files 
> (sources) between the nodes 
> - but how do I share the artifacts of the local M2 repository so 
> dependencies can be resolved properly?
>
> node(..) {
>   ..
>   stage("Build") {
>     // build it
>     sh("mvn clean install....")
>   }
>   ..
>   stash ( name: 'workspace', useDefaultExcludes: false, excludes: 
> "**/target/**/*.class, **/target/surefire-reports/**")
> }
>
> node(..) {
>   ..
>   stage("Deploy") {
>      sh("deploy.sh.....")
>   }
>   ..
> }
>
> node(..) {
>   unstash( name: 'workspace')
>   stage("Test") {
>     ..
>     sh("mvn test -Pit..")
>     ..
>   }
> }
>
> Is there a way (without declarative pipeline) to "reuse" the same node 
> like before? Or do I have to stash/unstash the local repo or parts of it, 
> too?
>
> Any other ideas ?
>
> Thanx for your responses, 
>
> Torsten
>

-- 
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-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/jenkinsci-users/81d3b97e-2235-46d0-b4b0-80976e29f484%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to