Re: Declarative Pipeline - Agent wonderment

2017-04-25 Thread Christopher Orr
On Thu, 20 Apr 2017, at 15:02, Danny Rehelis wrote:
> Help me understand this please, in case my Pipeline looks like this -
> 
> stage ('Stage #1') {
> agent { label 'builder' }
> stage ('Stage #2') {
> agent { label 'builder' }
> 
> Will the second stage run on the same builder labeled server instance
> (same one from first stage) or will pick any other possibly idle labeled 
> server
> available at the time?
> Is it possible to force "stickiness" for explicitly configured agents?

In this case, there's no guarantee that the two builds will run in the
same workspace, or even on the same agent, if there are multiple agents
with the 'builder' label.

For stickiness, you'd probably have to define your `agent` once at the
top level of the Pipeline, and then maybe do `agent none` in the stages
where you don't need that agent (not entirely sure whether that works).

Regards,
Chris

-- 
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/1493111797.3897618.955339536.6BB709B6%40webmail.messagingengine.com.
For more options, visit https://groups.google.com/d/optout.


Declarative Pipeline - Agent wonderment

2017-04-20 Thread Danny Rehelis
Help me understand this please, in case my Pipeline looks like this -

pipeline {
agent none
stages {
stage ('Stage #1') {
agent { label 'builder' }
steps {
echo "Hello World"
}
}
stage ('Stage #2') {
agent { label 'builder' }
steps {
echo "Hello World"
}
}
}
}

Will the second stage run on the same builder labeled server instance (same
one from first stage) or will pick any other possibly idle labeled server
available at the time?
Is it possible to force "stickiness" for explicitly configured agents?

-- 
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/CAObRFCUJrs_BrOqrDXH62E_27JpL3bBQDJf%3DWsWkdEO%3D8CmKdg%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.