Created
October 29, 2010 19:24
-
-
Save evizitei/654216 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 | |
# 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 |
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]}'"
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
thx for this.