Environment section should be evaluated before other sections

This issue is archived. You can view it, but you can't modify it. Learn more

XMLWordPrintable

      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.

            Assignee:
            Unassigned
            Reporter:
            Anders Hammar
            Archiver:
            Jenkins Service Account

              Created:
              Updated:
              Archived: