Re: Declarative Syntax: ability to run multiple stages inside a single agent

2017-04-12 Thread Kenneth Brooks
Thanks for the quick reply.

Unfortunately no.
We will have lots of other stages down the line that require different 
capabilities.

Here is a little larger example for illustrative purposes (using script 
syntax so you can see where the nodes exist)
** Note - Each node will be spun up with exactly the required 
binaries/capabilities needed thus you see all the stages with different 
node labels. That way each pipeline can move without being tied to a 
specific version of a tool on a specific agent.

node('java-1.7') {
   stage ('Build') {
   checkout scm
   // do some build stuff
   }

stage ('Submit to Sonar') {
   // do some mvn stuff to submit to sonar
   }

stage ('Submit for OSS Scanning'){
   // do some work for uploading to OSS scanning system
   }
}

stage ('Dev Deploy'){
 node('deploy-utility-1.0') {
   // do some deployment using our homegrown deployment binaries on this 
node
 }
}

stage ('Functional Tests'){
 node('java-1.7 && apache-maven-3.2.5') {
   // run test against a selenium grid
 }
 
 node('legacy-test-system-1.0'){
  // run some other functional tests using older stuff
 }
}

stage ('Performance Tests'){
 node('perf-test-1.0 && java-1.7 && apache-maven-3.2.5') {
   // run test using our internal perf test capabilities installed on this 
node
 }
}

stage ('UAT Deploy'){
 node('deploy-utility-1.0') {
 // do some deployment using our homegrown deployment binaries on this 
node
 }
}

stage ('Security Test'){
 node('java-1.8') {
 // do some security testing using something that requires java 1.8
 }
}

stage ('PROD Deploy'){
 node('deploy-utility-1.0') {
// do some deployment using our homegrown deployment binaries on this 
node
 }
}

-k

On Wednesday, April 12, 2017 at 4:25:51 PM UTC-4, Andrew Bayer wrote:
>
> Are you wanting to use the same node for most, if not all, of the 
> pipeline? If so, just use the top level agent directive.
>
> A.
>
> On Wed, Apr 12, 2017 at 1:18 PM Kenneth Brooks  > wrote:
>
>> As a user, I want to run multiple stages inside a single agent.
>>
>> Today we use the mesos plugin and spin up and spin down an agent on 
>> demand. I want to have 3 stages all run on that same agent before it spins 
>> down.
>> That way all stages can leverage that workspace before it is trashed.
>>
>> Current ability in script syntax:
>> node('java-1.8.0_45') {
>> stage ('Build') {
>> checkout scm
>> // do some build stuff
>> }
>>
>> stage ('Submit to Sonar') {
>> // do some mvn stuff to submit to sonar
>> }
>>
>> stage ('Submit for OSS Scanning'){
>> // do some work for uploading to OSS scanning system
>> }
>> }
>>
>> All of this happens on the node and I see it as 3 stages on my pipeline.
>>
>> With Declarative:
>> stages {
>> stage ('Build and Scan') {
>> agent { label "java-1.8.0_45" }
>> steps {
>> checkout scm
>> // do some build stuff
>>
>> // do some scan stuff
>>
>> // do some oss scan stuff
>> }
>> }
>>
>> I no longer can specify them to all happen in the same node unless I do 
>> this above, which then I can no longer define the stages.
>>
>>
>> Is there something I'm missing here?
>> Keep in mind the important part that the node is spun up and trashed on 
>> every invocation so we can't just get ahold of the previous/same agent 
>> again.
>>
>> Thanks,
>> Ken
>>
>> -- 
>> 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-use...@googlegroups.com .
>> To view this discussion on the web visit 
>> https://groups.google.com/d/msgid/jenkinsci-users/bba6cb94-f39c-4923-a400-027fb36a043f%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/a95147ae-e31d-405a-97eb-b86726f1116e%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Declarative Syntax: ability to run multiple stages inside a single agent

2017-04-12 Thread Andrew Bayer
Are you wanting to use the same node for most, if not all, of the pipeline?
If so, just use the top level agent directive.

A.

On Wed, Apr 12, 2017 at 1:18 PM Kenneth Brooks 
wrote:

> As a user, I want to run multiple stages inside a single agent.
>
> Today we use the mesos plugin and spin up and spin down an agent on
> demand. I want to have 3 stages all run on that same agent before it spins
> down.
> That way all stages can leverage that workspace before it is trashed.
>
> Current ability in script syntax:
> node('java-1.8.0_45') {
> stage ('Build') {
> checkout scm
> // do some build stuff
> }
>
> stage ('Submit to Sonar') {
> // do some mvn stuff to submit to sonar
> }
>
> stage ('Submit for OSS Scanning'){
> // do some work for uploading to OSS scanning system
> }
> }
>
> All of this happens on the node and I see it as 3 stages on my pipeline.
>
> With Declarative:
> stages {
> stage ('Build and Scan') {
> agent { label "java-1.8.0_45" }
> steps {
> checkout scm
> // do some build stuff
>
> // do some scan stuff
>
> // do some oss scan stuff
> }
> }
>
> I no longer can specify them to all happen in the same node unless I do
> this above, which then I can no longer define the stages.
>
>
> Is there something I'm missing here?
> Keep in mind the important part that the node is spun up and trashed on
> every invocation so we can't just get ahold of the previous/same agent
> again.
>
> Thanks,
> Ken
>
> --
> 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/bba6cb94-f39c-4923-a400-027fb36a043f%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/CAPbPdObPXLW26M4g%3DDKbmcXKQYcVoL1sr7fkqRann429qrGjGQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.