Thanx, now I´m doing something like:
String buildNode
node() {
buildNode = env.NODE_NAME
echo "performing build on node ${buildNode}"
}
checkpoint("built")
node('other') {
echo "running on any other node, currently it´s ${env.NODE_NAME}"
}
checkpoint("deployed")
node( buildNode ) {
echo "running on ${buildNode} again - it´s ${env.NODE_NAME}"
}
Am Montag, 23. Oktober 2017 22:54:06 UTC+2 schrieb Robert Hales:
>
> 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 [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/jenkinsci-users/43668c11-9203-481c-9aac-e3bfa963ded8%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.