Skip to content

Instantly share code, notes, and snippets.

@evizitei
Created October 29, 2010 19:24
Show Gist options
  • Star 7 You must be signed in to star a gist
  • Fork 7 You must be signed in to fork a gist
  • Save evizitei/654216 to your computer and use it in GitHub Desktop.
Save evizitei/654216 to your computer and use it in GitHub Desktop.
Whenever Chef Recipe on EY AppCloud
#
# Cookbook Name:: whenever
# Recipe:: default
#
ey_cloud_report "whenever" do
message "starting whenever recipe"
end
# Set your application name here
appname = "therapylogs"
if ['solo', 'util'].include?(node[:instance_role])
# be sure to replace "app_name" with the name of your application.
local_user = node[:users].first
execute "whenever" do
cwd "/data/#{appname}/current"
user local_user[:username]
command "whenever --update-crontab '#{appname}_#{node[:environment][:framework_env]}'"
action :run
end
ey_cloud_report "whenever" do
message "whenever recipe complete"
end
end
@avasenin
Copy link

thx for this.

@LukasBeaton
Copy link

This is great! Thank you.

Just thought I would mention that in my case I had to add "bundle exec" in the command.

command " bundle exec whenever --update-crontab '#{appname}_#{node[:environment][:framework_env]}'"

@ZenCocoon
Copy link

Thanks for sharing, really helpful. You can also use appname = node[:applications].keys.first

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment