Skip to content

Instantly share code, notes, and snippets.

View jbwyatt4's full-sized avatar

John Wyatt jbwyatt4

View GitHub Profile
@jbwyatt4
jbwyatt4 / hello.rb
Created October 23, 2013 09:13
Example code
print "Hello, world!"
@jbwyatt4
jbwyatt4 / deploysimpleway-4.rb
Created October 19, 2013 06:14
Fix permissions, run bundle, migrate, precompile assets and restart the server.
directory "/var/www" do
owner "user"
recursive true
end
# do not use ~... in vagrant, will goto vagrant user
execute "git clone git://github.com/jbwyatt4/#{node.default['bluebook']['app1']}.git /home/user/#{node.default['bluebook']['app1']}" do
user "user"
not_if do
::File.directory?("/home/user/#{node.default['bluebook']['app1']}")
@jbwyatt4
jbwyatt4 / deploysimpleway-3.rb
Created October 19, 2013 06:14
Remove old copy of app and copy over the latest version.
directory "/var/www" do
owner "user"
recursive true
end
# do not use ~... in vagrant, will goto vagrant user
execute "git clone git://github.com/jbwyatt4/#{node.default['bluebook']['app1']}.git /home/user/#{node.default['bluebook']['app1']}" do
user "user"
not_if do
::File.directory?("/home/user/#{node.default['bluebook']['app1']}")
@jbwyatt4
jbwyatt4 / deploysimpleway-2.rb
Created October 19, 2013 06:14
Pull the latest changes from the git repo.
directory "/var/www" do
owner "user"
recursive true
end
# do not use ~... in vagrant, will goto vagrant user
execute "git clone git://github.com/jbwyatt4/#{node.default['bluebook']['app1']}.git /home/user/#{node.default['bluebook']['app1']}" do
user "user"
not_if do
::File.directory?("/home/user/#{node.default['bluebook']['app1']}")
@jbwyatt4
jbwyatt4 / deploysimpleway-1.rb
Created October 19, 2013 06:14
Create the webroot and pull from a public repo.
directory "/var/www" do
owner "user"
recursive true
end
# do not use ~... in vagrant, will goto vagrant user
execute "git clone git://github.com/jbwyatt4/#{node.default['bluebook']['app1']}.git /home/user/#{node.default['bluebook']['app1']}" do
user "user"
not_if do
::File.directory?("/home/user/#{node.default['bluebook']['app1']}")
@jbwyatt4
jbwyatt4 / rubyinstall-11.rb
Last active December 25, 2015 22:49
Code to setup the template and restart the Nginx server.
apt_package "nodejs"
apt_package "curl"
apt_package "git-core"
apt_package "build-essential"
apt_package "libcurl4-openssl-dev"
apt_package "zlib1g-dev"
execute "curl -L get.rvm.io | bash -s stable --ruby=#{node.default['bluebook']['combined']}" do
not_if do
::File.directory?("/usr/local/rvm")
@jbwyatt4
jbwyatt4 / rubyinstall-10.rb
Created October 19, 2013 06:02
Install the Nginx Init scripts
apt_package "nodejs"
apt_package "curl"
apt_package "git-core"
apt_package "build-essential"
apt_package "libcurl4-openssl-dev"
apt_package "zlib1g-dev"
execute "curl -L get.rvm.io | bash -s stable --ruby=#{node.default['bluebook']['combined']}" do
not_if do
::File.directory?("/usr/local/rvm")
@jbwyatt4
jbwyatt4 / rubyinstall-8.rb
Last active December 25, 2015 22:48
Install Passenger and Rails gems + an example using attributes.
apt_package "nodejs"
apt_package "curl"
apt_package "git-core"
apt_package "build-essential"
apt_package "libcurl4-openssl-dev"
apt_package "zlib1g-dev"
execute "curl -L get.rvm.io | bash -s stable --ruby=#{node.default['bluebook']['combined']}" do
not_if do
::File.directory?("/usr/local/rvm")
@jbwyatt4
jbwyatt4 / nginx.conf.erb
Created October 19, 2013 05:49
Nginx erb template file
#user nobody;
worker_processes 1;
#error_log logs/error.log;
#error_log logs/error.log notice;
#error_log logs/error.log info;
#pid logs/nginx.pid;
@jbwyatt4
jbwyatt4 / rubyinstall-9.rb
Last active December 25, 2015 22:48
Issue the command for Passenger to install Nginx
apt_package "nodejs"
apt_package "curl"
apt_package "git-core"
apt_package "build-essential"
apt_package "libcurl4-openssl-dev"
apt_package "zlib1g-dev"
execute "curl -L get.rvm.io | bash -s stable --ruby=#{node.default['bluebook']['combined']}" do
not_if do
::File.directory?("/usr/local/rvm")