Skip to content

Instantly share code, notes, and snippets.

@PaulOstazeski
Last active December 25, 2015 05:09
Show Gist options
  • Save PaulOstazeski/6922007 to your computer and use it in GitHub Desktop.
Save PaulOstazeski/6922007 to your computer and use it in GitHub Desktop.
A broken chef recipe to deploy a rails application
maintainer "me"
maintainer_email "[email protected]"
license "All rights reserved"
description "Installs/Configures myproject"
long_description IO.read(File.join(File.dirname(__FILE__), 'README.md'))
version "0.0.1"
depends 'hostsfile'
depends 'database'
depends 'postgresql'
depends 'application'
depends 'application_ruby'
hostsfile_entry '127.0.0.1' do
hostname "#{node['fqdn']} #{node['hostname']} localhost"
end
(node['myproject']['hosts'] || {}).each_pair do |name, ip|
hostsfile_entry ip do
hostname name
end
end
application 'myproject' do
path '/home/myproject/app'
owner 'myproject'
group 'myproject'
repository '[email protected]:myproject/myproject.git'
revision 'master'
deploy_key IO.read(File.join(File.dirname(__FILE__), '..', '..', '..', 'ssh_key'))
rails do
bundler true
# database do
# database "myproject"
# username "myproject"
# password node['myproject']['database_password']
# end
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment