Re: Declarative Syntax: agent scope

2017-04-27 Thread Bert
I have a related agent scope request. Today, the agent is defined inside a 
stage. If multiple stages use the same agent and the agent has just one 
executor, then concurrent builds alternate stage-by-stage.

To prevent that, I'd like to set an agent for a couple of stages.

Regards,
Bert

On Wednesday, April 12, 2017 at 10:08:39 PM UTC+2, Kenneth Brooks wrote:
>
> When I specify an agent inside a stage, it then also applies to everything 
> in the 'post' section.
>
> I'm not sure that is alway the behavior I want. 
> Is there a way around this?
>
> Specifically, we have the ability to take a checkpoint (similar to the 
> enterprise edition checkpoint feature) but that should run outside the node.
>
> Currently we can do this in script world:
>
> node('java-1.8.0_45') {
>   stage ('Master Build') {
> checkout scm
> sh 'do some building'
>  }
> }
> captureSnapshot('BuildComplete')
>
> node('java-1.8.0_45') {
>   stage ('Dev Deploy') {
> sh 'do some deploying'
>  }
> }
> captureSnapshot('DeployComplete')
>
> In declarative syntax land, the  post actions
>
> pipeline {
> agent none   
> stages {
>
> stage ('Build') {
> agent { label "java-1.8.0_45" }
> steps {
> checkout scm
> sh 'do some building'
> }
> post {
> success {
> captureSnapshot('BuildComplete') // this is still 
> inside the node
> }
> }
> }
>
> stage ('Dev Deploy') {
> agent { label "java-1.8.0_45" }
> steps {
> checkout scm
> sh 'do some deploying'
> }
> post {
> success {
> captureSnapshot('DeployComplete') // this is still 
> inside the node
> }
> }
> }
> }
> }
>
>
> Do I have to setup another stage specifically for the captureSnapshot? I 
> really don't want to see that stage visually show up on my pipeline all 
> over the place.
>
>

-- 
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/09b6b839-8e01-471e-981e-b356da951002%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Declarative Syntax: agent scope

2017-04-14 Thread Baptiste Mathus
Hello,
IMO, you want to file an argued JIRA for each evolution you'd like.

The things you ask for don't appear crazy, but declarative being about
straightforwardness and opinionated, almost by definition nothing will be
added without deep thinking basically. Hence why each addition request
somehow requires its own discussion space if you want a chance to see it
landing.

My 2 cents.

Le 14 avr. 2017 3:03 PM, "Kenneth Brooks"  a
écrit :

Can we add *agent* as a child of *steps* so that we can decide which nodes
we want those steps to run on and that way we could then set the agent to
none for the overall stage?
And make *post* also available as a sibling of *stage* so that it can run
after a stage but not require a node?

I'm trying to find a way that post can run w/o being on a node.
I'm also trying to find a way to have multiple steps run inside a stage but
on different nodes.

On Wednesday, April 12, 2017 at 4:08:39 PM UTC-4, Kenneth Brooks wrote:
>
> When I specify an agent inside a stage, it then also applies to everything
> in the 'post' section.
>
> I'm not sure that is alway the behavior I want.
> Is there a way around this?
>
> Specifically, we have the ability to take a checkpoint (similar to the
> enterprise edition checkpoint feature) but that should run outside the node.
>
> Currently we can do this in script world:
>
> node('java-1.8.0_45') {
>   stage ('Master Build') {
> checkout scm
> sh 'do some building'
>  }
> }
> captureSnapshot('BuildComplete')
>
> node('java-1.8.0_45') {
>   stage ('Dev Deploy') {
> sh 'do some deploying'
>  }
> }
> captureSnapshot('DeployComplete')
>
> In declarative syntax land, the  post actions
>
> pipeline {
> agent none
> stages {
>
> stage ('Build') {
> agent { label "java-1.8.0_45" }
> steps {
> checkout scm
> sh 'do some building'
> }
> post {
> success {
> captureSnapshot('BuildComplete') // this is still
> inside the node
> }
> }
> }
>
> stage ('Dev Deploy') {
> agent { label "java-1.8.0_45" }
> steps {
> checkout scm
> sh 'do some deploying'
> }
> post {
> success {
> captureSnapshot('DeployComplete') // this is still
> inside the node
> }
> }
> }
> }
> }
>
>
> Do I have to setup another stage specifically for the captureSnapshot? I
> really don't want to see that stage visually show up on my pipeline all
> over the place.
>
> --
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/9dead877-9dde-4193-b372-9731b7ddfd6c%40googlegroups.
com

.

For more options, visit https://groups.google.com/d/optout.

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


Re: Declarative Syntax: agent scope

2017-04-14 Thread Kenneth Brooks
Can we add *agent* as a child of *steps* so that we can decide which nodes 
we want those steps to run on and that way we could then set the agent to 
none for the overall stage?
And make *post* also available as a sibling of *stage* so that it can run 
after a stage but not require a node?

I'm trying to find a way that post can run w/o being on a node.
I'm also trying to find a way to have multiple steps run inside a stage but 
on different nodes.

On Wednesday, April 12, 2017 at 4:08:39 PM UTC-4, Kenneth Brooks wrote:
>
> When I specify an agent inside a stage, it then also applies to everything 
> in the 'post' section.
>
> I'm not sure that is alway the behavior I want. 
> Is there a way around this?
>
> Specifically, we have the ability to take a checkpoint (similar to the 
> enterprise edition checkpoint feature) but that should run outside the node.
>
> Currently we can do this in script world:
>
> node('java-1.8.0_45') {
>   stage ('Master Build') {
> checkout scm
> sh 'do some building'
>  }
> }
> captureSnapshot('BuildComplete')
>
> node('java-1.8.0_45') {
>   stage ('Dev Deploy') {
> sh 'do some deploying'
>  }
> }
> captureSnapshot('DeployComplete')
>
> In declarative syntax land, the  post actions
>
> pipeline {
> agent none   
> stages {
>
> stage ('Build') {
> agent { label "java-1.8.0_45" }
> steps {
> checkout scm
> sh 'do some building'
> }
> post {
> success {
> captureSnapshot('BuildComplete') // this is still 
> inside the node
> }
> }
> }
>
> stage ('Dev Deploy') {
> agent { label "java-1.8.0_45" }
> steps {
> checkout scm
> sh 'do some deploying'
> }
> post {
> success {
> captureSnapshot('DeployComplete') // this is still 
> inside the node
> }
> }
> }
> }
> }
>
>
> Do I have to setup another stage specifically for the captureSnapshot? I 
> really don't want to see that stage visually show up on my pipeline all 
> over the place.
>
>

-- 
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/9dead877-9dde-4193-b372-9731b7ddfd6c%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Declarative Syntax: agent scope

2017-04-12 Thread Kenneth Brooks
When I specify an agent inside a stage, it then also applies to everything 
in the 'post' section.

I'm not sure that is alway the behavior I want. 
Is there a way around this?

Specifically, we have the ability to take a checkpoint (similar to the 
enterprise edition checkpoint feature) but that should run outside the node.

Currently we can do this in script world:

node('java-1.8.0_45') {
  stage ('Master Build') {
checkout scm
sh 'do some building'
 }
}
captureSnapshot('BuildComplete')

node('java-1.8.0_45') {
  stage ('Dev Deploy') {
sh 'do some deploying'
 }
}
captureSnapshot('DeployComplete')

In declarative syntax land, the  post actions

pipeline {
agent none   
stages {

stage ('Build') {
agent { label "java-1.8.0_45" }
steps {
checkout scm
sh 'do some building'
}
post {
success {
captureSnapshot('BuildComplete') // this is still 
inside the node
}
}
}

stage ('Dev Deploy') {
agent { label "java-1.8.0_45" }
steps {
checkout scm
sh 'do some deploying'
}
post {
success {
captureSnapshot('DeployComplete') // this is still 
inside the node
}
}
}
}
}


Do I have to setup another stage specifically for the captureSnapshot? I 
really don't want to see that stage visually show up on my pipeline all 
over the place.

-- 
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/c8d0ae35-2c58-49c8-9071-8adc02b8aaed%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.