我有一个看起来像这样的 Jenkins 管道
stage 'build app'
build 'app-build'
stash 'app-stash'
stage 'build container'
unstash 'app-stash'
build 'container-build'
从我们的 Kubernetes 系统构建app-build
和获取新节点。container-build
使用stash我想将工件从 转移app-build
到container-build
.
但是,在运行此管道时,会发生以下错误:
[Pipeline] stash
Required context class hudson.FilePath is missing
Perhaps you forgot to surround the code with a step that provides this, such as: node
[Pipeline] End of Pipeline
org.jenkinsci.plugins.workflow.steps.MissingContextVariableException: Required context class hudson.FilePath is missing
at org.jenkinsci.plugins.workflow.steps.StepDescriptor.checkContextAvailability(StepDescriptor.java:254)
at org.jenkinsci.plugins.workflow.cps.DSL.invokeStep(DSL.java:179)
我不想node
在我的管道中使用,因为我的节点上只有一个执行程序。是否可以在stash
没有node
指令的情况下使用?