Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Added first cut of scripts to the repository

Added .gitignore
Added a README for brevity
  • Loading branch information...
commit 928b6f548adf77c2602fcca7a3e02a2d0133c813 0 parents
@benschwarz benschwarz authored
1  .gitignore
@@ -0,0 +1 @@
+config/deploy.rb
3  Capfile
@@ -0,0 +1,3 @@
+load 'deploy' if respond_to?(:namespace) # cap2 differentiator
+Dir['vendor/plugins/*/recipes/*.rb'].each { |plugin| load(plugin) }
+load 'config/deploy'
20 README.markdown
@@ -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
10 config/deploy.rb.example
@@ -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}"
27 config/install.rb
@@ -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
BIN  config/stack/.DS_Store
Binary file not shown
4 config/stack/essential.rb
@@ -0,0 +1,4 @@
+package :build_essential do
+ description 'Build tools'
+ apt 'build-essential'
+end
9 config/stack/memcached.rb
@@ -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
11 config/stack/mysql.rb
@@ -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
20 config/stack/ruby_enterprise.rb
@@ -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
11 config/stack/scm.rb
@@ -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
48 config/stack/server.rb
@@ -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
Please sign in to comment.
Something went wrong with that request. Please try again.