You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Rewrite the underlying pipeline to use the Declarative Pipeline style.
DeclarativePipelines are much more strict than scripted. You can't arbitrarily execute code within stages() to dynamically generate stages.
when running on non-master, the confirm/apply stages are intentionally skipped. DeclarativePipelines make this difficult. We'd have to render the entire pipeline with confirm/apply on master, and render the entire pipeline with on non-master.
stages are currently nested, with around hooks. The plugin infrastructure will need to be rethought a little. around-all may need to mean applying an around to each individual stage.
this means rethinking the CrqPlugin, FileEnvironmentPropertiesPlugin, ConditionalApplyPlugin.
We cannot use Groovy.eval to dynamically generate a declarative pipeline
For some reason, you lose the ability to even create a declarative pipeline, once you assign this to a variable. Eg:
def Jenkinsfile = this
Jenkinsfile.pipeline {
} // This immediately triggers a Scripted Pipeline, altering what is considered valid syntax
The best compromise that I can think of:
Create a series of declarative pipeline "templates". A template defines a fixed number of stages. Each stage in the template is named "1", "2", "3", etc.
In terraform-pipeline, at the time of build(), count the number of Stages that the user has created. Pick the corresponding template that has exactly that many stages.
In each template stage, embed the corresponding terraform-pipeline stage, within a script block.
This solves the underlying problem of allowing entire environments to be Re-Run. This is also a terrible solution - the Declarative Pipeline syntax is simply too restrictive.
The text was updated successfully, but these errors were encountered:
DeclarativePipelines are much more strict than scripted. You can't arbitrarily execute code within
stages()
to dynamically generate stages.around
hooks. The plugin infrastructure will need to be rethought a little.around-all
may need to mean applying an around to each individual stage.DeclarativePipelines are an enormous pain.
this
to a variable. Eg:The best compromise that I can think of:
build()
, count the number of Stages that the user has created. Pick the corresponding template that has exactly that many stages.script
block.The text was updated successfully, but these errors were encountered: