Add Ability to Have Scheduled Builds (CRON)


#1

We are trying to setup nightly build on circle ci. I found the help page for how to do nightly build configuration.
But we got stuck, where we should run crontab command on circle ci so that it will schedule a job.


Is it possible to run some tests for example each hour?
#2

You cannot run CRON on circleci, you would need to set up a CRON job on one of your own servers (or any computer that is always powered on) in order to get nightly builds to work.


#3

Hi,

Are there any plans to introduce a more robust feature on circleci platform to run nightly builds?

Although suggestion above would work for most cases, it is still a very “jenkins” style one. As a user of hosted build service, I would try to escape cronjobs horrors at all cost.


Scheduled Builds
Basic scheduling support
#4

I have a heroku app which just triggers a build via the API using the free heroku scheduler and this buildpack https://github.com/ph3nx/heroku-binary-buildpack:

Procfile

program: bin/program

bin/program

#!/usr/bin/env bash

curl -X POST https://circleci.com/api/v1/project/org/app/tree/branch?circle-token=token

#5

Another option if you want to go server-less is to use AWS lambda scheduled events to call the circle API once a day (or however frequently you like)


#6

Thanks for the tip, this is pretty cool! We have an unwieldy number of cron jobs running nightly builds in support. Would be nice to clean some of them up by moving it over to Lambda.


#7

I post on our blog a sample using AWS Lambda function (Python). Scheduled Build - AWS and CircleCI API.


#8

Here is a serverless based project for scheduling hourly builds.


#9

Seriously, the lack of this functionality is a massive oversight.

The fact I’m now needing to spin up an instance, just to periodically trigger a build on a SaaS platform intended to alleviate the need to spin up instances for creating builds is utter madness. :rage:


#10

@aendrew AWS lambda is a good alternative. You can write from scratch or try the project I created with serverless.com’s tools. I have been using this for months and it works flawlessly and cost almost nothing.
https://github.com/godfreyhobbs/circleci-cron-serverless


#11

I have converted this into a feature request, if you would like to see this as a feature please click on the heart on the original post. Thanks for all of the feedback and workarounds so far!


#12

TravisCI provides CronJob feature as beta feature. https://docs.travis-ci.com/user/cron-jobs/
I’d like to see this feature on CircleCI, too.


#13

We have launched a first-class way to run scheduled jobs on CircleCI 2.0.
Below, please find the links to get started:
https://circleci.com/docs/2.0/workflows/#scheduling-a-workflow
https://circleci.com/docs/2.0/configuration-reference/#schedule


#14