Skip to content

Instantly share code, notes, and snippets.

@hiremaga
Created December 27, 2013 23:04
Show Gist options
  • Save hiremaga/8153874 to your computer and use it in GitHub Desktop.
Save hiremaga/8153874 to your computer and use it in GitHub Desktop.
Just an idea...
Job.describe("gorouter") do |job|
job.command = "bin/router -c /var/vcap/jobs/gorouter/config/gorouter.yml"
job.templates << "templates/gorouter.yml.erb", "config/gorouter.yml"
job.templates << "templates/logrotate.conf.erb", "config/logrotate.conf"
job.templates << "templates/syslog_forwarder.conf.erb", "config/syslog_forwarder.conf"
freq_min = job.properties.router && job.properties.router.logrotate && job.properties.router.logrotate.freq_min || 5
job.cron "*/#{freq_min} * * * * test -x /usr/sbin/logrotate && /usr/sbin/logrotate #{job.job_root}/config/logrotate.conf >> #{job.log_root}/gorouter_logrotate_cron.log 2>&1"
job.additional_packages << "common"
job.additional_packages << "syslog_aggregator"
job.dependencies << "golang"
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment