Last active
January 11, 2017 14:20
-
-
Save ZenCocoon/6256755 to your computer and use it in GitHub Desktop.
Whenever Chef Recipe on EY AppCloud
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# | |
# Cookbook Name:: whenever | |
# Recipe:: default | |
# | |
ey_cloud_report "whenever" do | |
message "starting whenever recipe" | |
end | |
if node[:instance_role] == 'solo' || | |
(node[:utility_instances].length > 0 && node[:utility_instances][0][:name] == node[:name]) || | |
(node[:utility_instances].length == 0 && node[:instance_role] == 'app_master') | |
node.engineyard.apps.each do |app, data| | |
execute "whenever" do | |
cwd "/data/#{app.name}/current" | |
user node[:users][0][:username] | |
command "bundle exec whenever --update-crontab '#{app.name}' --set environment=#{node[:environment][:framework_env]}" | |
action :run | |
end | |
end | |
ey_cloud_report "whenever" do | |
message "whenever recipe complete" | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment