-
Notifications
You must be signed in to change notification settings - Fork 66
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added first cut of scripts to the repository
Added .gitignore Added a README for brevity
- Loading branch information
0 parents
commit 928b6f5
Showing
12 changed files
with
164 additions
and
0 deletions.
There are no files selected for viewing
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
config/deploy.rb |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
load 'deploy' if respond_to?(:namespace) # cap2 differentiator | ||
Dir['vendor/plugins/*/recipes/*.rb'].each { |plugin| load(plugin) } | ||
load 'config/deploy' |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
## Scripts for [Sprinkle](http://github.com/crafterm/sprinkle/ "Sprinkle"), the provisioning tool | ||
|
||
Deploy a basic stack for running rack based ruby applications with ease! | ||
|
||
* Apache (Apt) | ||
* Ruby enterprise (Source) [includes rubygems] | ||
* Passenger (Rubygem) | ||
* Libmemcached (Source) | ||
* MySQL (Apt) | ||
* Git (Apt) | ||
|
||
### Requirements | ||
* Ruby | ||
* Capistrano | ||
* Sprinkle (github.com/crafterm/sprinkle) | ||
* An Ubuntu based VPS (known to not work on Debian Etch, haven't looked into why) | ||
|
||
### Thanks | ||
|
||
Marcus Crafter and other Sprinkle contributors |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
set :application, "your-app" | ||
set :repository, "git@github.com:you/your-app.git" | ||
set :server_url, "your-app-server.com" | ||
set :scm, :git | ||
|
||
role :app, server_url | ||
role :web, server_url | ||
role :db, server_url, :primary => true | ||
|
||
set :deploy_to, "/var/www/#{application}" |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
# Require our stack | ||
%w(essential server scm ruby_enterprise mysql memcached).each do |r| | ||
require "stack/#{r}" | ||
end | ||
|
||
policy :ffolio, :roles => :app do | ||
requires :ruby | ||
requires :appserver | ||
requires :database | ||
requires :webserver | ||
requires :scm | ||
requires :memcached | ||
end | ||
|
||
deployment do | ||
# mechanism for deployment | ||
delivery :capistrano do | ||
recipes 'deploy' | ||
end | ||
|
||
# source based package installer defaults | ||
source do | ||
prefix '/usr/local' | ||
archives '/usr/local/sources' | ||
builds '/usr/local/build' | ||
end | ||
end |
Binary file not shown.
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
package :build_essential do | ||
description 'Build tools' | ||
apt 'build-essential' | ||
end |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
package :memcached_daemon, :provides => :memcached do | ||
description 'Memcached, a distributed memory object store' | ||
apt %w( memcached ) | ||
end | ||
|
||
package :libmemcached do | ||
source 'http://download.tangent.org/libmemcached-0.25.tar.gz' | ||
requires :memcached | ||
end |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
package :mysql, :provides => :database do | ||
description 'MySQL Database' | ||
apt %w( mysql-server mysql-client libmysqlclient15-dev ) | ||
end | ||
|
||
package :mysql_driver do | ||
description 'Ruby MySQL database driver' | ||
gem 'mysql' | ||
|
||
requires :ruby | ||
end |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
package :ruby_enterprise, :provides => :ruby do | ||
description 'Ruby Enterprise Edition' | ||
version '1.8.6-20081215' | ||
source 'http://rubyforge.org/frs/download.php/48623/ruby-enterprise-1.8.6-20081215.tar.gz' do | ||
custom_install 'echo -en "\n\n\n\n" | ./installer' | ||
|
||
# Modify the passenger conf file to point to REE | ||
post :install, 'sed -i "s|^PassengerRuby [/a-zA-Z0-9.]*$|PassengerRuby /opt/ruby-enterprise-1.8.6-20081215/bin/ruby|" /etc/apache2/extras/passenger.conf' | ||
|
||
# Restart apache | ||
post :install, '/etc/init.d/apache2 restart' | ||
end | ||
|
||
verify do | ||
has_directory '/opt/ruby-enterprise-1.8.6-20081215' | ||
has_executable '/opt/ruby-enterprise-1.8.6-20081215/bin/ruby' | ||
end | ||
|
||
requires :apache | ||
end |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
package :git, :provides => :scm do | ||
description 'Git Distributed Version Control' | ||
version '1.5.6.3' | ||
source "http://kernel.org/pub/software/scm/git/git-#{version}.tar.gz" | ||
requires :git_dependencies | ||
end | ||
|
||
package :git_dependencies do | ||
description 'Git Build Dependencies' | ||
apt 'git', :dependencies_only => true | ||
end |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
# Contains software created by Phusion.nl which is Ruby Enterprise Edition | ||
# and mod_rails | ||
package :passenger, :provides => :appserver do | ||
description 'Phusion Passenger (mod_rails)' | ||
gem 'passenger' do | ||
post :install, 'echo -en "\n\n\n\n" | passenger-install-apache2-module' | ||
|
||
# Create the passenger conf file | ||
post :install, 'mkdir /etc/apache2/extras' | ||
post :install, 'touch /etc/apache2/extras/passenger.conf' | ||
post :install, "echo 'Include /etc/apache2/extras/passenger.conf' >> /etc/apache2/apache2.conf" | ||
|
||
[%q(LoadModule passenger_module /usr/lib/ruby/gems/1.8/gems/passenger-2.0.6/ext/apache2/mod_passenger.so), | ||
%q(PassengerRoot /usr/lib/ruby/gems/1.8/gems/passenger-2.0.6), | ||
%q(PassengerRuby /usr/bin/ruby1.8), | ||
%q(RailsEnv development)].each do |line| | ||
post :install, "echo '#{line}' >> /etc/apache2/extras/passenger.conf" | ||
end | ||
|
||
# Restart apache to note changes | ||
post :install, '/etc/init.d/apache2 restart' | ||
end | ||
|
||
verify do | ||
has_file '/etc/apache2/extras/passenger.conf' | ||
has_file '/usr/lib/ruby/gems/1.8/gems/passenger-2.0.6/ext/apache2/mod_passenger.so' | ||
has_directory '/usr/lib/ruby/gems/1.8/gems/passenger-2.0.6' | ||
end | ||
|
||
requires :apache | ||
requires :apache2_prefork_dev | ||
end | ||
|
||
package :apache, :provides => :webserver do | ||
description 'Apache2 web server.' | ||
apt 'apache2 apache2.2-common apache2-mpm-prefork apache2-utils libexpat1 ssl-cert' do | ||
post :install, 'a2enmod rewrite' | ||
end | ||
|
||
verify do | ||
has_process 'apache2' | ||
end | ||
end | ||
|
||
package :apache2_prefork_dev do | ||
description 'A dependency required by some packages.' | ||
apt 'apache2-prefork-dev' | ||
end |