forked from sprinkle-tool/sprinkle
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added some example packages. All of them have been tested personally …
…and work. Also added ruby specific verifiers.
- Loading branch information
Showing
11 changed files
with
173 additions
and
1 deletion.
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
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 @@ | ||
## Special package, anything that defines a 'source' package means build-essential should be installed for Ubuntu | ||
|
||
package :build_essential do | ||
description 'Build tools' | ||
apt 'build-essential' do | ||
# Update the sources and upgrade the lists before we build essentials | ||
pre :install, ['aptitude update', 'aptitude safe-upgrade', 'aptitude full-upgrade'] | ||
end | ||
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,13 @@ | ||
package :mysql, :provides => :database do | ||
description 'MySQL Database' | ||
apt %w( mysql-server mysql-client libmysqlclient15-dev ) | ||
end | ||
|
||
package :mysql_ruby_driver do | ||
description 'Ruby MySQL database driver' | ||
gem 'mysql' | ||
|
||
verify do | ||
ruby_can_load 'mysql' | ||
end | ||
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,16 @@ | ||
# Packages to install sqlite3 and the sqlite3 ruby driver. | ||
package :sqlite3, :provides => :database do | ||
description 'SQLite3 database' | ||
apt 'sqlite3' | ||
end | ||
|
||
package :sqlite3_ruby_driver do | ||
description 'Ruby SQLite3 library.' | ||
apt 'libsqlite3-dev libsqlite3-ruby1.8' | ||
|
||
requires :rubygems | ||
|
||
verify do | ||
ruby_can_load 'sqlite3' | ||
end | ||
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,55 @@ | ||
# Contains software created by Phusion.nl which is Ruby Enterprise Edition | ||
# and mod_rails | ||
|
||
package :ruby_enterprise do | ||
description 'Ruby Enterprise Edition' | ||
version '1.8.6-20080709' | ||
source 'http://rubyforge.org/frs/download.php/39611/ruby-enterprise-1.8.6-20080709.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-20080709/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-20080709' | ||
has_executable '/opt/ruby-enterprise-1.8.6-20080709/bin/ruby' | ||
end | ||
|
||
requires :apache | ||
requires :passenger | ||
end | ||
|
||
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.2/ext/apache2/mod_passenger.so), | ||
%q(PassengerRoot /usr/lib/ruby/gems/1.8/gems/passenger-2.0.2), | ||
%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.2/ext/apache2/mod_passenger.so' | ||
has_directory '/usr/lib/ruby/gems/1.8/gems/passenger-2.0.2' | ||
end | ||
|
||
requires :apache | ||
requires :apache2_prefork_dev | ||
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 :rails do | ||
description 'Ruby on Rails' | ||
gem 'rails' | ||
version '2.1.0' | ||
|
||
verify do | ||
has_executable 'rails' | ||
end | ||
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,17 @@ | ||
package :ruby do | ||
description 'Ruby Virtual Machine' | ||
version '1.8.6' | ||
apt %q(ruby1.8-dev ruby1.8 ri1.8 rdoc1.8 irb1.8 libreadline-ruby1.8 libruby1.8 libopenssl-ruby) do | ||
post :install, [%q(ln -s /usr/bin/ruby1.8 /usr/bin/ruby), | ||
%q(ln -s /usr/bin/ri1.8 /usr/bin/ri), | ||
%q(ln -s /usr/bin/rdoc1.8 /usr/bin/rdoc), | ||
%q(ln -s /usr/bin/irb1.8 /usr/bin/irb)] | ||
end | ||
|
||
verify 'binaries' do | ||
has_file '/usr/bin/ruby1.8' | ||
has_file '/usr/bin/ri1.8' | ||
has_file '/usr/bin/rdoc1.8' | ||
has_file '/usr/bin/irb1.8' | ||
end | ||
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,17 @@ | ||
package :rubygems do | ||
description 'Ruby Gems Package Management System' | ||
version '1.2.0' | ||
source "http://rubyforge.org/frs/download.php/38646/rubygems-#{version}.tgz" do | ||
custom_install 'ruby setup.rb' | ||
post :install, 'ln -s /usr/bin/gem1.8 /usr/bin/gem' | ||
post :install, 'gem update' | ||
post :install, 'gem update --system' | ||
end | ||
|
||
verify 'binary' do | ||
has_file '/usr/bin/gem1.8' | ||
has_symlink '/usr/bin/gem', '/usr/bin/gem1.8' | ||
end | ||
|
||
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,15 @@ | ||
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 |
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,19 @@ | ||
module Sprinkle | ||
module Verifiers | ||
# = Ruby Verifiers | ||
# | ||
# The verifiers in this module are ruby specific. | ||
module Ruby | ||
Sprinkle::Verify.register(Sprinkle::Verifiers::Ruby) | ||
|
||
# Checks if ruby can require the <tt>files</tt> given. <tt>rubygems</tt> | ||
# is always included first. | ||
def ruby_can_load(*files) | ||
# Always include rubygems first | ||
files = files.unshift('rubygems').collect { |x| "require '#{x}'" } | ||
|
||
@commands << "ruby -e \"#{files.join(';')}\"" | ||
end | ||
end | ||
end | ||
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