As Andrew mentions a "block" is step that requires a closure.

The original way that 'stage' was implemented left holes in the usability
and some features did not work as well as intended. Namely, concurrency and
promotion did not work well and it was hard to define the boundaries of a
stage.

https://issues.jenkins-ci.org/browse/JENKINS-26107
https://issues.jenkins-ci.org/browse/JENKINS-30269
https://issues.jenkins-ci.org/browse/JENKINS-27039
https://issues.jenkins-ci.org/browse/JENKINS-29892

Rather than replacing 'stage' with a 'label' step we decided to keep and
overload 'stage' and deprecate the old syntax that does now work.  In
addition, we have added a 'lock' step and will soon add a 'milestone' step
to isolate these features and make the behavior more predictable and
controllable.

The new 'stage' requires a block to give it defined boundaries but no
longer accepts a concurrency value. Concurrency needs to be controlled by
the lock step.

This gives much greater flexibility such as:

lock ("resource") {
  stage ("checkout){
    dosomething()
  }
  stage ("build") {
    dosomething()
 }
 timeout(time: 3, unit: 'SECONDS') {
stage ("test"){
}
}

Or any other combination. 'Milestone' will be ready soon and this step will
ensure that newer builds continue but older builds are aborted to ensure
delivery timing. You can read the details in the ticket.

I was hoping to blog about all of this when 'Milestone' is available. For
the time being, nothing will change for the existing 'stage' functionality.
You will see the message in your log file but nothing will stop working.








On Thu, Sep 1, 2016 at 3:05 PM, Andrew Bayer <[email protected]> wrote:

> Basically, the new syntax is:
>
> stage("Checkout") {
>   checkout scm
> }
>
> A.
>
> On Thu, Sep 1, 2016 at 6:04 PM, Mark Waite <[email protected]>
> wrote:
>
>> Thanks for asking the question!  I see the same message and didn't find
>> an explanation (at least that I understood) of the intention for a block
>> argument in a stage.
>>
>> Looking forward to the answer..
>>
>> Mark Waite
>>
>> On Thu, Sep 1, 2016 at 4:00 PM <[email protected]> wrote:
>>
>>> Hi,
>>>
>>> I now have the following message into my pipeline workflow but I don't
>>> really know what exactly is the new proper way of doing it.
>>>
>>> Here's a simplified version of what I do
>>> node
>>> {
>>>    stage 'Checkout'
>>>    ...
>>>    stage 'Build'
>>>    ...
>>>    stage 'Build Unit Tests'
>>>    ...
>>> }
>>>
>>>
>>> but now I see this message for every stage into my console output:
>>>
>>> [Pipeline] stage (Checkout)
>>> *17:10:09* Using the ‘stage’ step without a block argument is deprecated
>>> *17:10:09* Entering stage Checkout
>>>
>>>
>>> If I check this page:
>>> https://jenkins.io/doc/pipeline/steps/pipeline-stage-step/
>>>
>>> versus good call:
>>> https://jenkins.io/doc/pipeline/steps/workflow-basic-steps/
>>>
>>> seem like it's deprecated but I don't known what exactly replace it?!?
>>> and can I keep the stage view like this?!?
>>>
>>>
>>> <https://lh3.googleusercontent.com/-_ZcY6JkHbuc/V8ifmhj5-8I/AAAAAAAAAEA/CtaN-Mwgl84eA6We73qoT7zBHXFt0-QwgCLcB/s1600/Capture.PNG>
>>>
>>>
>>>
>>>  stage now takes a block argument, what is that argument exactly? what
>>> is considered a block?
>>>
>>> Thanks
>>> Jerome
>>>
>>> --
>>> 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/ms
>>> gid/jenkinsci-users/b7ef10d7-5f0c-4d2d-87c1-bcc42ef33144%
>>> 40googlegroups.com
>>> <https://groups.google.com/d/msgid/jenkinsci-users/b7ef10d7-5f0c-4d2d-87c1-bcc42ef33144%40googlegroups.com?utm_medium=email&utm_source=footer>
>>> .
>>> 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 [email protected].
>> To view this discussion on the web visit https://groups.google.com/d/ms
>> gid/jenkinsci-users/CAO49JtGzmn%2Bq8xWrJdYAbR6wYyqX5gNmyCa%2
>> BZxLDDBScYouS%3Dw%40mail.gmail.com
>> <https://groups.google.com/d/msgid/jenkinsci-users/CAO49JtGzmn%2Bq8xWrJdYAbR6wYyqX5gNmyCa%2BZxLDDBScYouS%3Dw%40mail.gmail.com?utm_medium=email&utm_source=footer>
>> .
>>
>> 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 [email protected].
> To view this discussion on the web visit https://groups.google.com/d/
> msgid/jenkinsci-users/CAPbPdOZ4Y4R-4drgiZBOC-2FH%
> 2B5xC4dG47tieTa0BmqSHG1wFA%40mail.gmail.com
> <https://groups.google.com/d/msgid/jenkinsci-users/CAPbPdOZ4Y4R-4drgiZBOC-2FH%2B5xC4dG47tieTa0BmqSHG1wFA%40mail.gmail.com?utm_medium=email&utm_source=footer>
> .
>
> For more options, visit https://groups.google.com/d/optout.
>



-- 

Patrick Wolf
Product Director - Jenkins
CloudBees

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

Reply via email to