問題タブ [jenkins-declarative-pipeline]
For questions regarding programming in ECMAScript (JavaScript/JS) and its various dialects/implementations (excluding ActionScript). Note JavaScript is NOT the same as Java! Please include all relevant tags on your question; e.g., [node.js], [jquery], [json], [reactjs], [angular], [ember.js], [vue.js], [typescript], [svelte], etc.
jenkins - Jenkins宣言型パイプラインでメソッドを作成するには?
Jenkins スクリプト パイプラインでは、メソッドを作成して呼び出すことができます。
Jenkins 宣言型パイプラインでも可能ですか? そしてどうやって?
jenkins - Jenkins shared library - how to define common options for a declarative pipeline
I have many similar configs in declarative pipelines, like agent, tools, options, or post section. Is there any option to define those option somehow, so that an individual job has only to define the steps (which may come from a shared library)?
There is a description at "Defining a more stuctured DSL", where there is something similar to that what I want to achieve, but this seems to apply to scripted pipelines.
Actually, I tried something like that, trying to pass a closure to the pipeline, but this does not seem to work. Probably if it worked, there was some documentation on how to do it.
and calling it somehow like this: