Re: Declarative Pipeline v1.4.0-beta-1 - Matrix stages

2019-10-13 Thread Firmsoil Soil
Thanks very much Liam,

I will immediately try and demo this in my organization for multiple 
multi-platform (pun intended) use cases!

This is why I love jenkins plugins API ecosystem, it is by far the deepest 
and most feature rich in the CI landscape and promotes immense code reuse.

Sincerely
Firmsoil

On Tuesday, August 6, 2019 at 1:12:32 PM UTC-7, Liam Newman wrote:
>
> Hello all!
>
> I'm pleased to announce the release of Declarative Pipeline 1.4.0-beta-1 
> with Matrix Stages. This feature allows pipeline authors to specify a 
> matrix of one or more dimensions and run a set of stages on the combination 
> of values specified. 
>
> One simple use case where Matrix Stages are valuable is running browser 
> tests on several operating systems and browser combinations.  Let’s say we 
> want to run tests on Linux, OS X, and Windows for browsers Chrome, Firefox, 
> IE, and Safari. We’ll want to run tests for IE on Windows only and we’ll 
> want tests for Safari to run on OS X and Windows.  Here’s what that 
> scenario will look like using the new “matrix” directive:
>
> Jenkinsfile
>
> --
>
> pipeline {
>
> agent none
>
> stages {
>
> stage("foo") {
>
> matrix {
>
> axes {
>
> axis {
>
> name 'os'
>
> values "linux", "windows", "mac"
>
> }
>
> axis {
>
> name 'browser'
>
> values "firefox", "chrome", "safari", "ie"
>
> }
>
> }
>
> excludes {
>
> exclude {
>
> axis {
>
> name 'os'
>
> values 'linux'
>
> }
>
> axis {
>
> name 'browser'
>
> values 'safari'
>
> }
>
> }
>
> exclude {
>
> axis {
>
> name 'os'
>
> notValues 'windows'
>
> }
>
> axis {
>
> name 'browser'
>
> values 'ie'
>
> }
>
> }
>
> }
>
> stages {
>
> stage("first") {
>
> steps {
>
> echo "Running on OS=$os, BROWSER=$browser"
>
> }
>
> }
>
> stage("second") {
>
> steps {
>
> // ... Second stage steps ... 
>
> }
>
> }
>
> }
>
> }
>
> }
>
> }
>
> }
>
> --
>
> In the example, we specify two axes and the values for each of them. Then, 
> we use the optional “excludes” directive to remove undesired combinations 
> from the matrix. Finally, we specify one or more stages that we want to run 
> on each combination.   
>
> Log fragment:
>
> …
>
> [Pipeline] stage
>
> [Pipeline] { (foo)
>
> [Pipeline] parallel
>
> [Pipeline] { (Branch: Matrix: os = 'linux', browser = 'firefox')
>
> [Pipeline] { (Branch: Matrix: os = 'windows', browser = 'firefox')
>
> [Pipeline] { (Branch: Matrix: os = 'mac', browser = 'firefox')
>
> [Pipeline] { (Branch: Matrix: os = 'linux', browser = 'chrome')
>
> [Pipeline] { (Branch: Matrix: os = 'windows', browser = 'chrome')
>
> [Pipeline] { (Branch: Matrix: os = 'mac', browser = 'chrome')
>
> [Pipeline] { (Branch: Matrix: os = 'windows', browser = 'safari')
>
> [Pipeline] { (Branch: Matrix: os = 'mac', browser = 'safari')
>
> [Pipeline] { (Branch: Matrix: os = 'windows', browser = 'ie')
>
> ...
>
>
>
> Declarative Pipeline 1.4.0-beta-1 is available from the experimental 
> update center now (
> https://jenkins.io/doc/developer/publishing/releasing-experimental-updates/). 
> I look forward to hearing what you think of this feature and what you’d 
> like to see in future updates to Declarative Pipeline. 
>
> Thanks,
>
> Liam Newman 
>
> Senior Software Engineer - Pipeline 
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"Jenkins Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to jenkinsci-dev+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/jenkinsci-dev/f3bf8ebf-82f5-4b5c-9178-4c664748f309%40googlegroups.com.


Re: Declarative Pipeline v1.4.0-beta-1 - Matrix stages

2019-08-07 Thread Andrew Bayer
This is fantastic to see land - I've been dreaming of matrix in Declarative
for years, so thank you, Liam, for making it happen!

A.

On Tue, Aug 6, 2019 at 4:12 PM Liam Newman  wrote:

> Hello all!
>
> I'm pleased to announce the release of Declarative Pipeline 1.4.0-beta-1
> with Matrix Stages. This feature allows pipeline authors to specify a
> matrix of one or more dimensions and run a set of stages on the combination
> of values specified.
>
> One simple use case where Matrix Stages are valuable is running browser
> tests on several operating systems and browser combinations.  Let’s say we
> want to run tests on Linux, OS X, and Windows for browsers Chrome, Firefox,
> IE, and Safari. We’ll want to run tests for IE on Windows only and we’ll
> want tests for Safari to run on OS X and Windows.  Here’s what that
> scenario will look like using the new “matrix” directive:
>
> Jenkinsfile
>
> --
>
> pipeline {
>
> agent none
>
> stages {
>
> stage("foo") {
>
> matrix {
>
> axes {
>
> axis {
>
> name 'os'
>
> values "linux", "windows", "mac"
>
> }
>
> axis {
>
> name 'browser'
>
> values "firefox", "chrome", "safari", "ie"
>
> }
>
> }
>
> excludes {
>
> exclude {
>
> axis {
>
> name 'os'
>
> values 'linux'
>
> }
>
> axis {
>
> name 'browser'
>
> values 'safari'
>
> }
>
> }
>
> exclude {
>
> axis {
>
> name 'os'
>
> notValues 'windows'
>
> }
>
> axis {
>
> name 'browser'
>
> values 'ie'
>
> }
>
> }
>
> }
>
> stages {
>
> stage("first") {
>
> steps {
>
> echo "Running on OS=$os, BROWSER=$browser"
>
> }
>
> }
>
> stage("second") {
>
> steps {
>
> // ... Second stage steps ...
>
> }
>
> }
>
> }
>
> }
>
> }
>
> }
>
> }
>
> --
>
> In the example, we specify two axes and the values for each of them. Then,
> we use the optional “excludes” directive to remove undesired combinations
> from the matrix. Finally, we specify one or more stages that we want to run
> on each combination.
>
> Log fragment:
>
> …
>
> [Pipeline] stage
>
> [Pipeline] { (foo)
>
> [Pipeline] parallel
>
> [Pipeline] { (Branch: Matrix: os = 'linux', browser = 'firefox')
>
> [Pipeline] { (Branch: Matrix: os = 'windows', browser = 'firefox')
>
> [Pipeline] { (Branch: Matrix: os = 'mac', browser = 'firefox')
>
> [Pipeline] { (Branch: Matrix: os = 'linux', browser = 'chrome')
>
> [Pipeline] { (Branch: Matrix: os = 'windows', browser = 'chrome')
>
> [Pipeline] { (Branch: Matrix: os = 'mac', browser = 'chrome')
>
> [Pipeline] { (Branch: Matrix: os = 'windows', browser = 'safari')
>
> [Pipeline] { (Branch: Matrix: os = 'mac', browser = 'safari')
>
> [Pipeline] { (Branch: Matrix: os = 'windows', browser = 'ie')
>
> ...
>
>
>
> Declarative Pipeline 1.4.0-beta-1 is available from the experimental
> update center now (
> https://jenkins.io/doc/developer/publishing/releasing-experimental-updates/).
> I look forward to hearing what you think of this feature and what you’d
> like to see in future updates to Declarative Pipeline.
>
> Thanks,
>
> Liam Newman
>
> Senior Software Engineer - Pipeline
>
> --
> You received this message because you are subscribed to the Google Groups
> "Jenkins Developers" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to jenkinsci-dev+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/jenkinsci-dev/78b8f8e6-b61c-49dc-ba24-9d25f0baa825%40googlegroups.com
> 
> .
>

-- 
You received this message because you are subscribed to the Google Groups 
"Jenkins Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to jenkinsci-dev+unsubscr...@googlegroups.com.
To view this discussion on the web visit 

Re: Declarative Pipeline v1.4.0-beta-1 - Matrix stages

2019-08-07 Thread Jesse Glick
On Tue, Aug 6, 2019 at 4:12 PM Liam Newman  wrote:
> exclude {
> axis {
> name 'os'
> notValues 'windows'
> }

This seems like a lot of conceptual weight for something that could
have been expressed in Scripted with a simple `if`-statement or two.
Is there some guiding principle for how much logic ought to be
expressible in Declarative?

-- 
You received this message because you are subscribed to the Google Groups 
"Jenkins Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to jenkinsci-dev+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/jenkinsci-dev/CANfRfr0tcwd_Mc81ZU7EX6aa9RXYtJukZnSqpkpwC%2BR0jfTt%3Dw%40mail.gmail.com.


Declarative Pipeline v1.4.0-beta-1 - Matrix stages

2019-08-06 Thread Liam Newman


Hello all!

I'm pleased to announce the release of Declarative Pipeline 1.4.0-beta-1 
with Matrix Stages. This feature allows pipeline authors to specify a 
matrix of one or more dimensions and run a set of stages on the combination 
of values specified. 

One simple use case where Matrix Stages are valuable is running browser 
tests on several operating systems and browser combinations.  Let’s say we 
want to run tests on Linux, OS X, and Windows for browsers Chrome, Firefox, 
IE, and Safari. We’ll want to run tests for IE on Windows only and we’ll 
want tests for Safari to run on OS X and Windows.  Here’s what that 
scenario will look like using the new “matrix” directive:

Jenkinsfile

--

pipeline {

agent none

stages {

stage("foo") {

matrix {

axes {

axis {

name 'os'

values "linux", "windows", "mac"

}

axis {

name 'browser'

values "firefox", "chrome", "safari", "ie"

}

}

excludes {

exclude {

axis {

name 'os'

values 'linux'

}

axis {

name 'browser'

values 'safari'

}

}

exclude {

axis {

name 'os'

notValues 'windows'

}

axis {

name 'browser'

values 'ie'

}

}

}

stages {

stage("first") {

steps {

echo "Running on OS=$os, BROWSER=$browser"

}

}

stage("second") {

steps {

// ... Second stage steps ... 

}

}

}

}

}

}

}

--

In the example, we specify two axes and the values for each of them. Then, 
we use the optional “excludes” directive to remove undesired combinations 
from the matrix. Finally, we specify one or more stages that we want to run 
on each combination.   

Log fragment:

…

[Pipeline] stage

[Pipeline] { (foo)

[Pipeline] parallel

[Pipeline] { (Branch: Matrix: os = 'linux', browser = 'firefox')

[Pipeline] { (Branch: Matrix: os = 'windows', browser = 'firefox')

[Pipeline] { (Branch: Matrix: os = 'mac', browser = 'firefox')

[Pipeline] { (Branch: Matrix: os = 'linux', browser = 'chrome')

[Pipeline] { (Branch: Matrix: os = 'windows', browser = 'chrome')

[Pipeline] { (Branch: Matrix: os = 'mac', browser = 'chrome')

[Pipeline] { (Branch: Matrix: os = 'windows', browser = 'safari')

[Pipeline] { (Branch: Matrix: os = 'mac', browser = 'safari')

[Pipeline] { (Branch: Matrix: os = 'windows', browser = 'ie')

...



Declarative Pipeline 1.4.0-beta-1 is available from the experimental update 
center now (
https://jenkins.io/doc/developer/publishing/releasing-experimental-updates/). 
I look forward to hearing what you think of this feature and what you’d 
like to see in future updates to Declarative Pipeline. 

Thanks,

Liam Newman 

Senior Software Engineer - Pipeline 

-- 
You received this message because you are subscribed to the Google Groups 
"Jenkins Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to jenkinsci-dev+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/jenkinsci-dev/78b8f8e6-b61c-49dc-ba24-9d25f0baa825%40googlegroups.com.