Due to some maintenance issues, this service has been switched in read-only mode, you can find more information about the why

and how to migrate your plugin documentation in this blogpost

Skip to end of metadata
Go to start of metadata

Adds capability to schedule a build for a later point in time. Asks the user for a date and time and adds the build to the build queue with the respective quiet period.

Plugin Information

View Schedule Build on the plugin site for more information.

This plugin is up for adoption. Want to help improve this plugin? Click here to learn more!

Scheduling Builds

Press the "Schedule Build" link on the project page or use the schedule build action in the list view.


Then select date and time when to schedule the build.


The build will be added to the build queue with the respective quiet period.

Configure Schedule Build Plugin

The configuration of the schedule build plugin is very simple. There are only two parameters on the Jenkins system configuration page.

The default time which is set when a user wants to schedule a build may be configured and time zone used by the plugin, which might differ from the system time zone.

Changelog

Version 0.5.0

  • Add support for scheduling with higher accuracy (thanks matsuu for the PR)

Version 0.4.0


34 Comments

  1. Unknown User (vivaro)

    I get a HTTP 404 page not found error when I try to schedule a job after installing your plugin.Please advise.

    I have jobs in progress at the moment so have not restarted Jenkins after installing your plugin. However, I did get SUCCESS when I installed it without restart.

    1. Unknown User (vivaro)

      Please ignore my previous comment. The problem resolved itself when I restarted the jenkins service.

  2. Unknown User (darthopto)

    Just wondering if there is any way to schedule a build to go everyday at 7pm, rather than manually having to schedule it every day?

    1. Unknown User (oleg_nenashev)

      @Curtis

      Jenkins provides this feature out-of-the-box (see Build Triggers section in job configuration pages)

  3. Unknown User (marjohartman)

    When working via a reverse proxy, this plugin does not work because it injects the configured Jenkins URL.

    Is there a way to solve this?

  4. Unknown User (omsri_vas)

    I tried several times installing this plugin version 0.3.3 and uninstalled tried again. But, Getting the same error even though I restarted Jenkins servers.

    It gives the same 404 pages while schedule the job. What is the solution?

    HTTP Status 404 -


    type Status report

    message

    description The requested resource is not available.


    Apache Tomcat/7.0.53

    HTTP Status 404 -

    type Status report

    message

    description The requested resource is not available.

  5. Unknown User (ebrahim_moshaya)

    This plugin does not work with jobs scheduled within folders using "cloudbees-folder" plugin https://wiki.jenkins-ci.org/display/JENKINS/CloudBees+Folders+Plugin

    Any chance this can be updated to work with folders?

  6. Unknown User (amonsen)

    Heads up: this plugin appears to use (only) UTC, regardless of the time zone passed to the JVM and shown in the Jenkins web UI.

  7. Unknown User (jamesco)

    With jenkins 2.2 and Schedule Build Plugin 0.3.4 I get a warning "plugin offered a GET link". There did appear to be some sort of a job scheduled and it said it "expires in 13hr" which was correct for the time I scheduled. But the job did not seem to run :-(.

    The warning seen: "You must use POST method to trigger builds. (From scripts you may instead pass a per-project authentication token, or authenticate with your API token.) If you see this page, it may be because a plugin offered a GET link; file a bug report for that plugin."

    Url, presumably the GET:http://jenkins:xxxx/job/jobname/build?delay=47212sec

    This seems like a very useful plugin and I'd like to get it working for myself and others.

    http://stackoverflow.com/questions/35029486/how-can-i-schedule-a-job-to-run-in-the-future-but-only-one-time-ever/39858002#39858002

    1. Unknown User (jamesco)

      This bug covers the issue. Fix in source code works for me if CSRF Protection is disabled in jenkins.

      Need to wait for new release of plugin (>0.3.4). (or build from source)

      https://issues.jenkins-ci.org/browse/JENKINS-28961

  8. Unknown User (pirlouis)

    Hi,

    I am new using this plugin on Jenkins version 2.19.3, and installed it with no issue on my environment.

    On the dashboard home page, I have different tabs to sort my jobs and after this plugin installation, I only see the schedule build action icon on the "All" tab. They are not present in my others tabs.

    If this is an issue ? Is it possible to fix it or maybe is there a workaround ?

    Thank you.

    Regards.

  9. Unknown User (neuhausjulian)

    Hi guys,

    we moved from Freestyle-Jobs to Pipeline-Jobs and now we got a 404-Error if we try to use the "schedule-build-plugin".

    Should this happen ? Is it for some reason not possible to use this plugin with pipeline-jobs or is this just some kind of bug ?

    Thanks for help.

    Regards

    Julian

  10. Unknown User (neuhausjulian)

  11. Unknown User (chrismahoneyboprc)

    I'm running 0.3.4 on Jenkins LTS 2.60.1 (on Windows) and have found that all scheduled builds disappear when Jenkins is restarted. Is this expected behaviour or is it likely to be related to my configuration?

    1. Unknown User (pingunaut)

      Do you have the chance to test the latest 0.4.0-beta from the experimental plugins update center and check if the issue does still exist? ..working fine here (on linux). I'll try to test on windows asap.

      1. Unknown User (chrismahoneyboprc)

        No luck, I'm afraid. It's still losing everything on restart :(

        1. Unknown User (pingunaut)

          OK, thanks a lot for testing though.
          There are several issues regarding lost build queues on windows (linked below), but as far as I can see, the issues should already be fixed in your version.
          Nevertheless, you can check if the issue is a general queue problem with the following steps:

          1. Open in your browser: YOUR_JOB_URL/build?delay=100000sec  (will be a blank page, but will start the job with the given delay)
          2. Open YOUR_JOB_URL in the browser and check if the job was added to the queue
          3. Restart jenkins

          If the job disappears from the queue after performing the steps above, your problem is probably not related to the schedule-build plugin.

           

          JENKINS-41775 - Getting issue details... STATUS

          JENKINS-32820 - Getting issue details... STATUS

          1. Unknown User (chrismahoneyboprc)

            The build disappeared on restart. Thanks for helping with the troubleshooting but it looks like you're right; the problem doesn't seem to be with the plugin.

  12. Unknown User (aljaz)

    Hello,
    I would like to use this plugin in workflow with parameters, but when I installed the plugin I can see option to schedule it for date and time is there also option to include parameters from that job. Meaning that I would need to set time, date and 4 parameters that should be included when workflow jobs is triggered.
    Thank you in advance.
    Best regards.

    1. Unknown User (vizzard)

      When you set the time and click "Schedule" you will see the page to set all parameters of your Job. Then you click "Build" and that is when build is scheduled.

  13. Unknown User (vizzard)

    Is there a way to schedule multiple builds with the same set of parameters? Currently I can schedule multiple builds only when parameters are different.

    Also, when build is scheduled and another build with same set of parameters is triggered to run now, the scheduled build disappears.

    I guess the workaround would be to create some dummy parameter with generated hash as a default value so the parameters would always be different but I don't like it.

     

    1. Unknown User (pingunaut)

      I think this is not an issue with schedule build plugin. If you try to start a job multiple times using the "Build now" button, you will probably face the same behavior.

      So i think this workaround is okay. An implementation of this feature within the plugin would internally have to use the same mechanism

      1. Unknown User (vizzard)

        Using "Build with Parameters" I can run multiple builds with the same parameters without problem.

        For Pipeline this is default behavior. For Freestyle projects "Execute concurrent builds if necessary" option in Job configuration makes it possible.

        Unfortunately scheduling multiple builds with the same parameters does not work in any of these scenarios.

        1. Unknown User (pingunaut)

          Hi Aron,

          for freestyle jobs i can't reproduce the behavior you are describing. "Execute concurrent builds if necessary" has no effect on the behavior. If there is a job with the same parameters in the queue (not yet running), no new job with the same parameters will be queued. Do I miss something here?

          Nevertheless... this plugin does not provide a way to schedule multiple builds with the same set of parameters. If the suggested workaround workaround is not a solution for you, please file an issue, so the feature might be added in the future.

          WBR,

          Martin

  14. Unknown User (john3333)

    Currently you can only schedule 1 build at a time, Is there a plan to update this plugin so you can schedule multiple builds?

    I use Jenkins multijobs to deploy applications to multiple ENVs and occasionally they request deploys to begin after hours. It would be awesome to have the capability to use the Schedule Build for multiple requests

    thanks

    1. Unknown User (pingunaut)

      Hi John,

      not sure if I understand the requirement. As the discussion above states, you can use the plugin to run multiple builds. The only restriction is, that you cannot schedule the same build multiple times using the same build parameters.

      If your requirement is to schedule multiple builds at a time in one step, that's currently not planned. That would also require heavy refactoring, because that's nothing that can easily be realized based on the existing code.

      For more complex scenarios than just scheduling single jobs, maybe the following idea provides a solution for you:

      1. Create a new pipeline with a build parameter to choose a date (Could be a simple string parameter or if you want to prevent format issue, you can try Validating String Parameter Plugin).
      2. Add a script block to calculate the seconds between now and the chosen date
      3. Add another stage to run all the stuff you want to schedule, like triggering other builds. You can also use parameters to choose what to do at the scheduled time. With this solution you have maximum flexibility.

      A working example pipeline looks like this:

      import java.text.SimpleDateFormat
      pipeline {
          agent any
          stages {
              stage('wait until next steps are scheduled'){
                  steps {
                      script {
                          def dateFormat = new SimpleDateFormat("dd/MM/yyyy HH:mm:ss")
                          def scheduledDate = dateFormat.parse(scheduledDateString)
                          echo "Parsed the following scheduled date: " + dateFormat.format(scheduledDate)
                          def secondsToScheduledDate = (scheduledDate.getTime() - new Date().getTime())/1000
                          sleep secondsToScheduledDate
                      }       
                  }
              }
              stage('do other stuff') {
                  //
                  steps {
                      echo 'works :)'
                  }
              }
          }
      }
      
      

      On the first run, you will have to approve the following Signatures in the In-Process Script Approval section:

      method java.text.DateFormat parse java.lang.String
      method java.util.Date getTime

      Hope this helps,

      Best regards,

      Martin

      1. Unknown User (john3333)

        Hi Martin,

        thanks for the reply

        I am using a multi-job to orchestrate multiple deployments of EAR files to WebSphere servers. let me break down the scenario I am trying to accomplish with this plugin.

        ( Each individual jobs deploys 1 or more EAR files )

        Job A / Job B / Job C

        Server01 / Server02

        Monday @10pm I want to deploy jobs A, B & C to server01 so I use this plugin to schedule that to happen starting at 10pm but then I want to deploy the same 3 jobs to server02 at 3am. 

        When I use the Schedule build plugin to setup the 10pm deploy it works fine and I see the job queue'd up and ready to go at the given time. The problem is when I go to schedule the 3am deploy to a different server it doesn't allow me to do that. 

        I was expecting to see multiple entries with diff Expires times

         

         

        Both requested deployment times are outside of regular business hours so I was hoping to be able to queue up the same multi job to run at different times

        1. Unknown User (dragon788)

          Unknown User (john3333) We do something similar, but what we do is configured a core job that has the "execution" logic, it takes parameters and does the heavy lifting, then we have lightweight "trigger" jobs. These jobs are configured to be run with few parameters maybe a Git SHA or something else "unique", and they pass to the "core job" those dynamic parameters and possibly some hardcoded parameters like "serverName" or "environment" and this keeps our deploy/action logic in one place, while also allowing us to ensure that the core job can only be called from these trigger jobs so somebody can't pass a random Git SHA to deploy to production, they have to run "assemble.prod" which examines "deploy.dev" and gathers the Git SHA from there, since we want to make sure it went through a testing environment first, and then they call "appdeploy.prod.server02", which calls "appdeploy" with "enviroment=prod" and "server=server02" and "GitSHA=<output from assemble.prod>".

  15. Unknown User (dragon788)

    It appears that while you can set the default timezone, this does NOT apply to the "Default time" when resolved at the "Schedule Build" level. For example I set the Timezone to America/New_York, which is UTC -5 or -4 depending on daylight savings time. I left the "Default Time" as 10:00:00 PM and saved and then went to a job and hit "Schedule Build", but in the time that appeared it was "<today's date> 06:00:00 PM", which appears to be "Default Time" offset by the timezone. This isn't a huge issue as I was able to set the correct time and verify the build was scheduled for the right time, but I even tried changing it from the default 10PM to see if that changed anything, but it did not.

    I think ideally the documentation should be updated to note that the "Default Time" is always UTC, and the time that shows up in "Schedule Build" will be whatever time zone is configured. One thing that would be VERY handy is having it display the configured Time Zone in the "Schedule Build" dialog, because our team works across 3-4 timezones and if somebody goes to schedule a resource intensive build based on their own timezone to be after hours, it could impact someone else who might still be working at that time.

    1. Unknown User (pingunaut)

      Thanks a lot for your feedback! Definitely worth a new release. I'll add that asap.

  16. Unknown User (scsvel)

    Hi all, I would like to know if this plug-in supports the schedule build option with build parameters. Ex. I have a job which will take 2 parameters, and every-time when I build - I will specify the parameters to build (Build with Parameters option). I want the schedule-build support for my job and wondering whether I can schedule the build by specifying my Build parameters.

  17. Unknown User (john3333)

    when you select the button you are prompted to enter the date&time you want your job to execute, Once you have done that it will then ask you to populate any parameters within your job. 

    1. Unknown User (scsvel)

      Thanks, Got it.

  18. Unknown User (nairajit13)

    When I try to schedule a build it says "submitting to the server..." then show page cannot be displayed.

    Can you guys please help me on this issue.

    And I also want to know if we can change date format from MM/DD/YY to DD/MM/YY and also can the clock can change from 12hr format to 24hr format.