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

Add ability to specify parameters in the crontab

      I was missing the possibility to pass a parameter to a crontab line, so that I can do different things on different days.

      e.g.
      We have a linux that is built every day except Saturdays (~1h) and on Sundays we run a clean build (~10h), where Saturday is reserved for other projects that run a clean build.
      The only way for me was to create a conditional build step. It blows up the job configuration and gets decoupled from the crontab:
      So when someone changes the crontab from Sunday to Saturday for clean builds, he will also have to change the day in the conditional build step.

      My proposal is to extend the crontab syntax by something like:

      MIN HOUR DOM MONTH DOW % PARAM1=VALUE1,PARAM2=VALUE2

      This would than schedule a build with the given parameters.

      Would others be interested too?

          [JENKINS-16352] Add ability to specify parameters in the crontab

          I have same problem,
          I am not able to pass parameters from Job A to Job B. Job A is Approval job which will be approved by manager.
          The second job has to pick the parameter and should wait for the scheduled production time and gets build.
          I am not sure about this parameterized scheduler plugin.
          I will give a try and let you guys know how it works.
          If you guys any alternative way please let me know.

          Thanks

          srikanth reddy added a comment - I have same problem, I am not able to pass parameters from Job A to Job B. Job A is Approval job which will be approved by manager. The second job has to pick the parameter and should wait for the scheduled production time and gets build. I am not sure about this parameterized scheduler plugin. I will give a try and let you guys know how it works. If you guys any alternative way please let me know. Thanks

          +1

          I have exactly this use-case. Will try out the parameterized-scheduler-plugin in the meantime.

          Paul Lanzerstorfer added a comment - +1 I have exactly this use-case. Will try out the parameterized-scheduler-plugin in the meantime.

          Harsh Parekh added a comment -

          +1

          I see this feature having a lot potential. Especially if we can extend Blue Ocean's UI. 

          Harsh Parekh added a comment - +1 I see this feature having a lot potential. Especially if we can extend Blue Ocean's UI. 

          Baptiste Mathus added a comment - Please see https://wiki.jenkins.io/display/JENKINS/Parameterized+Scheduler+Plugin

          Was this fixed and added to Jenkins core, or is the "fix" to go use the Parameterized Scheduler Plugin?

          I ask, because I found parameterizedCron documented over at https://jenkins.io/doc/pipeline/steps/workflow-multibranch/ for the "Pipeline: Multibranch" plugin. However, despite having the latest version of the plugin listed at https://plugins.jenkins.io/workflow-multibranch (2.17), Jenkins still tells me:
          java.lang.NoSuchMethodError: No such DSL method 'parameterizedCron' found among steps

          Cody Casterline added a comment - Was this fixed and added to Jenkins core, or is the "fix" to go use the Parameterized Scheduler Plugin? I ask, because I found parameterizedCron documented over at https://jenkins.io/doc/pipeline/steps/workflow-multibranch/  for the "Pipeline: Multibranch" plugin. However, despite having the latest version of the plugin listed at https://plugins.jenkins.io/workflow-multibranch  (2.17), Jenkins still tells me: java.lang.NoSuchMethodError: No such DSL method 'parameterizedCron' found among steps

          Daniel Beck added a comment -

          fcodyc Unfortunately the docs are structured by top-level element, in this case properties. Since that one allows you to specify any job properties, those will show up nested below it, no matter what plugin provides them.

          Daniel Beck added a comment - fcodyc Unfortunately the docs are structured by top-level element, in this case properties . Since that one allows you to specify any job properties, those will show up nested below it, no matter what plugin provides them.

          Bassam Khouri added a comment -

          "Parameterized Scheduler" plugin's helpdoc has the following

           

          Clicking on "this Jenkins issue" points to this ticket.  Clearly, the original author the "Parameterized Scheduler" plugin has idea to integrate the plugin into the core.   This ticket should be reopened, or the help test from the "Parameterized Schedule" plugin should be updated.

          Bassam Khouri added a comment - "Parameterized Scheduler" plugin's helpdoc has the following   Clicking on "this Jenkins issue" points to this ticket.  Clearly, the original author the "Parameterized Scheduler" plugin has idea to integrate the plugin into the core.   This ticket should be reopened, or the help test from the "Parameterized Schedule" plugin should be updated.

          Fatema Hasta added a comment - - edited

          batmat Are we still available to use job dsl support for Parameterized Schedular for the Job dsl v 1.76? I am not able to get this plugin working 

          Fatema Hasta added a comment - - edited batmat Are we still available to use job dsl support for Parameterized Schedular for the Job dsl v 1.76? I am not able to get this plugin working 

          In which version of Jenkins has this feature been added?

          Dominik Kaspar added a comment - In which version of Jenkins has this feature been added?

          This feature is accessible through the plugin:

          https://plugins.jenkins.io/parameterized-scheduler/

          Baptiste Mathus added a comment - This feature is accessible through the plugin: https://plugins.jenkins.io/parameterized-scheduler/

            batmat Baptiste Mathus
            flozzone Florin Hillebrand
            Votes:
            18 Vote for this issue
            Watchers:
            29 Start watching this issue

              Created:
              Updated:
              Resolved: