问题描述
我的 Jenkins 部署失败并出现以下错误:
[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
这里是定义黄瓜的地方:
always {
cucumber reportTitle: 'Apickli test report',fileIncludePattern: '**/reports.json',jsonReportDirectory: "target",sortingMethod: 'ALPHABETICAL',trendsLimit: 10
}
}
这是一个新的 Jenkins 构建,同样的部署也适用于“旧”服务器。我添加了黄瓜插件。我会错过另一个吗?
解决方法
我是 Jenkins 的新手,我发现这个 always {} 语句在每个阶段之后运行,并且需要在第一阶段解决问题。