Skip to content

Instantly share code, notes, and snippets.

@chrisa
Created September 1, 2011 16:36
Show Gist options
  • Select an option

  • Save chrisa/1186600 to your computer and use it in GitHub Desktop.

Select an option

Save chrisa/1186600 to your computer and use it in GitHub Desktop.
ruby_block "locate resque assets" do
block do
app = data_bag_item("apps", "platformapi")
resque_gem_path = %x{ cd "#{app['deploy_to']}/current" && bundle show resque }.chomp
node.run_state[:resque_assets_path] = "#{resque_gem_path}/lib/resque/server/public"
end
notifies :create, "template[#{node['apache']['dir']}/sites-available/platformapi.conf]", :immediately
end
template "#{node['apache']['dir']}/sites-available/platformapi.conf" do
source "platformapi-apache.conf.erb"
mode 0644
variables(
"resque_assets_path" => node.run_state[:resque_assets_path]
)
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment