set:environment,"staging"set:output,{:error=>"log/cron_error_log.log",:standard=>"log/cron_log.log"}weekly_of_day=:sunday# every sundayweekly_of_time={:at=>'0:00 am'}# every sunday 0:00ammonthly='0 0 1 * *'# monthly 0 0 1 * * (every first day of month at 0:00am)quarterly='0 0 1 1,4,7,10 *'# quarterly 0 0 1 1,4,7,10 * (every 3 months at 0:00am start from the first day in january)job_type:rbenv_rake,%Q{export PATH=~/.rbenv/shims:~/.rbenv/bin:/usr/bin:$PATH; eval "$(rbenv init -)"; cd :path && RAILS_ENV=staging bundle exec rake :task --silent >> log/cron_log.log 2>> log/cron_error_log.log}everyweekly_of_day,weekly_of_timedorbenv_rake"email_notification:send_email_notification_weekly"endeverymonthlydorbenv_rake"email_notification:send_email_notification_monthly"end
在持续集成开发的场景下,除了开发环境(提供给Dev的验证环境),测试环境(提供QA的测试环境),一般还会有一个UAT环境(用户验收测试环境 - User Acceptance Test),它是离生产环境最近的一个预备环境,就像上面所说的staging。
通过Rails Server命令启动环境,默认是development。
12345678
=>BootingPuma=>Rails4.2.0applicationstartingindevelopmentonhttp://localhost:3000=>Run`rails server -h`formorestartupoptions=>Ctrl-CtoshutdownserverPuma2.11.1starting...*Minthreads:0,maxthreads:16*Environment:development*Listeningontcp://localhost:3000