-
Improvement
-
Resolution: Not A Defect
-
Minor
-
None
Hi, so using the declarative pipeline it appears if you have agent none set at the top of the pipeline and agents defined per stage, you are unable to have a post section that executes certain steps (that require a node context). The following will result in an error::
pipeline { agent none stages { stage('Example') { steps { echo 'Hello World' } } } post { always { deleteDir() } } }
Required context class hudson.FilePath is missing Perhaps you forgot to surround the code with a step that provides this, such as: node ERROR: Attempted to execute a step that requires a node context while agent none was specified. Be sure to specify your own node { ... } blocks when using agent none.
I'm guessing its expected behavior but would it be possible to associate an agent with the post section as we do with stages?
Thanks, David
- relates to
-
JENKINS-64874 declarative pipeline post do not execute in agent
- Open