-
Improvement
-
Resolution: Unresolved
-
Minor
-
None
-
Jenkins LTS 2.249.3
pipeline-model-definition-plugin 1.7.2
For a multibranch pipeline we have a pipeline like this:
pipeline { agent none environment { RELEASE_BRANCH = 'master' // ... } triggers { cron(env.BRANCH_NAME == env.RELEASE_BRANCH ? '0 18 * * 7' : '') } // ... }
The use case is to have the release branch rebuilt on a scheduled interval.
However, this doesn't work as env.RELEASE_BRANCH is not set when the trigger is evaluated. I suggest that the environment section is evaluated first of all sections or at least as one of the first, so that env variables can be used in other sections.
Or possibly a better option is that the sections are evaluated in the order they are defined?