Skip to content

Instantly share code, notes, and snippets.

@buccolo
Last active December 26, 2015 11:19
Show Gist options
  • Save buccolo/7143172 to your computer and use it in GitHub Desktop.
Save buccolo/7143172 to your computer and use it in GitHub Desktop.
# Executes nginx recipe.
include_recipe "detroit::nginx"
# Creates deploy directory with correct permissions.
directory "/data/www" do
owner "nginx"
group "nginx"
mode "755"
end
# Deploys the given git project to the deploy directory.
git "/data/www" do
repository "[email protected]:brunobuccolo/detroit.git"
revision "master"
action :sync
user "nginx"
group "nginx"
end
# apt-get install this package if not installed.
package "nginx"
# Use nginx.conf.erb with my attributes and variables to create the file below with correct permissions.
template "/etc/nginx/nginx.conf" do
source "nginx.conf.erb"
owner "root"
group "root"
mode "644"
end
# Starts nginx.
# Configures nginx to start at boot.
service "nginx" do
action [:start, :enable]
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment