Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Using the ‘stage’ step without a block argument is deprecated

When building a Jenkins pipeline job (Jenkins ver. 2.7.4), I get this warning:

Using the ‘stage’ step without a block argument is deprecated

How do I fix it?

Pipeline script snippet:

stage 'Workspace Cleanup'
deleteDir()
like image 404
Boris Avatar asked Sep 12 '16 07:09

Boris


1 Answers

From Jenkins pipeline stage step doc:

An older, deprecated mode of this step did not take a block argument...

In order to remove the warning just add a block argument:

stage('Stage Name') {
   // some block
}

You can also generate a stage step using Snippet Generator.

like image 95
Boris Avatar answered Oct 17 '22 17:10

Boris