詹金斯管道使用藏匿我有詹金斯管道看起来像这样在没有节点
stage 'build app'
build 'app-build'
stash 'app-stash'
stage 'build container'
unstash 'app-stash'
build 'container-build'
的建立app-build
和container-build
从我们Kubernetes系统获得新的节点。
With 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
在我的管道,因为我只有在我的节点一个执行者。 如果没有node
指令,是否可以使用stash
?
隐藏将使用上下文隐藏所以如果你不在一个节点上或在不同的节点上,那么源代码就建立了,你可能不会隐藏你想要的东西,詹金斯可以有效地处理执行者。是空闲的,它可以在一个执行器上运行多个 – Rik