Uploaded image for project: 'Jenkins'
  1. Jenkins
  2. JENKINS-54265

Sending Parameters or initialize environment variables

      Jenkins Version: 2.138.2
      GitHub Branch Source Plugin Version 2.4.1

      Within our Jenkins-Setup we integrated a github.dsl which is able to detect new projects or branches within a project and creates dynamically new Pipeline-Jobs. Every project contains a Jenkinsfile, which defines the build-process.

      Within our organization, we would like to set-up an integrate and push mechanism, in order to keep a master-branch clean from any not working source-code.

      To lock the jobs within a project, we would like to use the option "lock resource: any-name". If you add a specific name, the locking works just fine. But we would like to set the name of the resource to lock dynamically via either parameters or environments variables.

      At the time, the options-block gets evaluated the environment does not seem to be available, hence any env-var is null and cannot be used.

      Is it possible to expand the configuration within the github-dsl to send parameters to the generated job, so that these parameters contain values like the project-name or similar, that can be used inside the option-block?

      Or is there a way to initialize the environment variables, so that these can be used within the option-block?

          [JENKINS-54265] Sending Parameters or initialize environment variables

          Liam Newman added a comment -

          Are you talking about the JobDSL plugin?

          Liam Newman added a comment - Are you talking about the JobDSL plugin?

            Unassigned Unassigned
            leherrma Lena Herrmann
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated: