Issue
My Jenkins deployment is failing with the following error:
[Pipeline] stage
[Pipeline] { (Declarative: Post Actions)
[Pipeline] cucumber
Error when executing always post condition:
org.jenkinsci.plugins.workflow.steps.MissingContextVariableException: Required context class hudson.FilePath is missing
Perhaps you forgot to surround the code with a step that provides this, such as: node
Here is where cucumber is defined:
always {
cucumber reportTitle: 'Apickli test report',
fileIncludePattern: '**/reports.json',
jsonReportDirectory: "target",
sortingMethod: 'ALPHABETICAL',
trendsLimit: 10
}
}
This is a new Jenkins build and this same deployment works on the "old" server. I have the cucumber plugin added. Could I be missing another one?
Solution
I'm new to Jenkins and figured out that this always {} statement runs after each stage and needed to fix an issue in the first stage.
Answered By - teoheras