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

load build parameters during repository scan

    Details

    • Type: New Feature
    • Status: Open (View Workflow)
    • Priority: Minor
    • Resolution: Unresolved
    • Component/s: pipeline
    • Environment:
      jenkins 2.220, running in kubernetes, using declarative pipelines & multi-branch pipelines
    • Similar Issues:

      Description

      It's a massive bugbear for me and I'm sure many others.. having to build a pipeline once before you can 'Build with Parameters'.

      It could be as simple as checking out just the jenkinsfile(s) during the repository scan and load the parameters before the first build (obviously as an option to enable it as it would slow down the repository scan).

      Alternatively, give us a 'load/refresh parameters' button that starts the pipeline but only until it has got the parameters and then stops by itself before doing any build steps.

        Attachments

          Activity

          Hide
          brandonfryslie Brandon Fryslie added a comment - - edited

          This is not necessary if you are using the Job DSL plugin (which you should be regardless).  Instead of defining the parameters in your Jenkinsfile, put them in the .groovy file where your Job DSL is defined.  Then the parameters are available on the initial run of the job.

          https://jenkinsci.github.io/job-dsl-plugin/

           

          EDIT:  Apologies, I wasn't implying that this isn't a valid feature request.  However, using the Job DSL allows you to achieve what you are asking, and it makes your life easier in the long run as well.

          Show
          brandonfryslie Brandon Fryslie added a comment - - edited This is not necessary if you are using the Job DSL plugin (which you should be regardless) .  Instead of defining the parameters in your Jenkinsfile, put them in the .groovy file where your Job DSL is defined.  Then the parameters are available on the initial run of the job. https://jenkinsci.github.io/job-dsl-plugin/   EDIT:  Apologies, I wasn't implying that this isn't a valid feature request.  However, using the Job DSL allows you to achieve what you are asking, and it makes your life easier in the long run as well.
          Hide
          gl1koz3 Edgars Batna added a comment - - edited

          I don't know what Brandon means - the link does not provide any information on why would we need Job DSL when we're already using Multibranch Pipeline. As I see it, Job DSL has nothing to do with this issue, plus it has its own assumptions and use cases which do not fit to our scenarios.

          This is a missing important feature and I can even see it as a bug, because it makes using expressions for default values impossible.

          Show
          gl1koz3 Edgars Batna added a comment - - edited I don't know what Brandon means - the link does not provide any information on why would we need Job DSL when we're already using Multibranch Pipeline. As I see it, Job DSL has nothing to do with this issue, plus it has its own assumptions and use cases which do not fit to our scenarios. This is a missing important feature and I can even see it as a bug, because it makes using expressions for default values impossible.
          Hide
          reschex Roland Eschenburg added a comment -

          Edgars Batna - Agreed.
          Whilst I see Brandon's point that using the Job DSL plugin would be a potential 'workaround' - I disagree with the 'which you should be regardless' assessment. What plugins someone can/can't use or wants to/doesn't want to use is up to the individual.

          Using Jenkinsfiles but creating build jobs manually is still a very common pattern and in those scenarios this feature would be incredibly useful. 

          Show
          reschex Roland Eschenburg added a comment - Edgars Batna - Agreed. Whilst I see Brandon's point that using the Job DSL plugin would be a potential 'workaround' - I disagree with the 'which you should be regardless' assessment. What plugins someone can/can't use or wants to/doesn't want to use is up to the individual. Using Jenkinsfiles but creating build jobs manually is still a very common pattern and in those scenarios this feature would be incredibly useful. 

            People

            • Assignee:
              Unassigned
              Reporter:
              reschex Roland Eschenburg
            • Votes:
              1 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

              • Created:
                Updated: