DEV Community

Discussion on: Jenkins Pipelines and their dirty secrets 1.

Collapse
 
harryg profile image
Harald Göttlicher • Edited

Scripted Pipelines always are enclosed within a node {} block.

This is not really correct. You only need the node block if you actually do something on a node.
In your example, you could just put the node block around the 'sh' command together with its 'def workspace = pwd()' (which you could omit, as it is default).
It is a good practice not to waste executors if you don't need them, e.g. for just triggering other jobs and echoing in the log, you don't need a node at all.

Still thanks for your nice blog!