How to schedule builds

by bradrydzewski

Drone does not provide any native capabilities for scheduling builds. Instead, we recommend using third party tools like cron to schedule builds using the API or command line tools.

Example command to (re)-launch a build:

drone build start --fork <repository> <build>

Example command to get the last build number, by branch:

drone build last --format="{{ .Number }}" --branch=<branch> <repository>

Example cronjob combining the above examples to launch a nightly build at 10pm.

crontab -e
* 22 * * * drone build start --fork octocat/hello-world \
  $(drone build last --format="{{ .Number }}" --branch=master octocat/hello-world)