Jenkins has a nice relatively comprehensive documentation about Jenkinsfile syntax. But I still not find there an answer is it possible to do a flow control on the top level of pipeline? Literally include something if just in pipeline {} section (Declarative) like:
pipeline {
if (bla == foo) {
triggers {
...configuration
}
}
or
pipeline {
triggers {
if (bla == foo) {
something...
}
}
}
triggers section is a section which can be included only once and only in the pipeline section. But if statement has to be applied only in stage level seems.
Do anyone know how to conditionally include something in direcitves, such as, triggers, or conditionally include directives itself?