• Icon: New Feature New Feature
    • Resolution: Unresolved
    • Icon: Minor Minor
    • pipeline
    • jenkins 2.220, running in kubernetes, using declarative pipelines & multi-branch pipelines

      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.

          [JENKINS-61147] load build parameters during repository scan

          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.

          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.

          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.

          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.

          gl1koz3 - 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. 

          Roland Eschenburg added a comment - gl1koz3 - 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. 

            Unassigned Unassigned
            reschex Roland Eschenburg
            Votes:
            3 Vote for this issue
            Watchers:
            5 Start watching this issue

              Created:
              Updated: