gitlabhq/gitlab-ci — pull request #45 by mrichie (2012-12-26 09:33:17+00:00)
Title: add schedule job support

### it works by follow step
first add two fields to project
1. always_build field : means no matter the git project is updated, it will be build in schedule
2. polling_interval field : means the interval of schedule, and the format is interger end with [s|m|d], short for seconds | minutes | day, more detail at [rufus-scheduler](https://github.com/jmettraux/rufus-scheduler) `every` usage
3. start resque scheduler services like this
`nohup bundle exec rake environment resque:work QUEUE=runner,scheduler_task VVERBOSE=1 RAILS_ENV=development PIDFILE=tmp/pids/resque_worker.pid > ./log/resque.log &`

`nohup bundle exec rake environment resque:scheduler VVERBOSE=1 RAILS_ENV=development PIDFILE=tmp/pids/resque_schedule.pid > ./log/schedule.log &`

it can be found it resque_dev.sh

at last , show the schedule log below
** [17:25:10 2012-12-26] 84810: got: (Job{scheduler_task} | SchedulerJob | ["run", 2])
** [17:25:10 2012-12-26] 84810: resque-1.23.0: Forked 6230 at 1356513910
** [17:25:10 2012-12-26] 6230: resque-1.23.0: Processing scheduler_task since 1356513910
From github.com:xxx.git
e0a033a..15baee5 development -> origin/development
** [17:25:28 2012-12-26] 6230: done: (Job{scheduler_task} | SchedulerJob | ["run", 2])
** [17:25:28 2012-12-26] 84810: Checking runner
** [17:25:28 2012-12-26] 84810: Checking scheduler_task
** [17:25:28 2012-12-26] 84810: Sleeping for 5.0 seconds
** [17:25:28 2012-12-26] 84810: resque-1.23.0: Waiting for runner,scheduler_task