私はこのような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ノードに executor が 1 つしかないため、パイプラインで使用したくありません。ディレクティブstashなしで使用できますか?node