-
-
Save zetter/5885994 to your computer and use it in GitHub Desktop.
Setup whenever on engineyard for all deployed applications that have the whenever gem bundled on the util instance called 'util'
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 | |
# | |
# for the until instance named 'util' | |
if node[:name] == 'util' | |
ey_cloud_report "whenever" do | |
message "Starting whenever recipe" | |
end | |
app_names = node[:applications].keys | |
local_user = node[:users].first | |
app_names.each do |app_name| | |
execute "setting whenever for #{app_name}" do | |
cwd "/data/#{app_name}/current" | |
user local_user[:username] | |
command "bundle exec whenever --update-crontab '#{app_name}_#{node[:environment][:framework_env]}'" | |
action :run | |
only_if { ::File.exists?("/data/#{app_name}/current/ey_bundler_binstubs/whenever")} | |
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