Jenkinsfile 部署在黄瓜步骤失败

时间:2021-07-30 17:28:39

标签: jenkins cucumber

我的 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 构建,同样的部署也适用于“旧”服务器。我添加了黄瓜插件。我会错过另一个吗?

1 个答案:

答案 0 :(得分:0)

我是 Jenkins 的新手,我发现这个 always {} 语句在每个阶段之后运行,并且需要在第一阶段解决问题。