josh-slicehost 0.0.2.1 → 0.0.2.2

Sign up to get free protection for your applications and to get access to all the features.
data/MIT-LICENSE CHANGED
@@ -1,4 +1,4 @@
1
- Copyright (c) 2008 Joshua Peek
1
+ Copyright (c) 2009 Joshua Peek
2
2
 
3
3
  Permission is hereby granted, free of charge, to any person obtaining
4
4
  a copy of this software and associated documentation files (the
data/README CHANGED
@@ -10,4 +10,13 @@ The recipes are designed to work stand alone apart from the standard set of Capi
10
10
 
11
11
  require 'capistrano/ext/slicehost' in your deploy.rb file
12
12
 
13
- Copyright (c) 2008 Joshua Peek, updated by Oleg Zhurbiy, released under the MIT license
13
+ Contributors
14
+ ============
15
+
16
+ * Oleg Zhurbiy
17
+ * Thomas Balthazar
18
+ * Fran Diéguez
19
+ * Stephen Lumenta
20
+ * Jared Giles
21
+
22
+ Copyright (c) 2009 Joshua Peek, released under the MIT license
@@ -81,4 +81,9 @@ namespace :apache do
81
81
  put render("vhost", binding), application
82
82
  sudo "mv #{application} /etc/apache2/sites-available/#{application}"
83
83
  end
84
+
85
+ desc "Install Apache"
86
+ task :install, :roles => :web do
87
+ sudo "aptitude install -y apache2 apache2.2-common apache2-mpm-prefork apache2-utils libexpat1 ssl-cert"
88
+ end
84
89
  end
@@ -74,14 +74,19 @@ namespace :aptitude do
74
74
  Updates software packages and creates "a solid base for the 'meat' of the \
75
75
  server". This task should be run only once when you are first setting up your \
76
76
  new slice.
77
+
78
+ For set another language different from en_GB.UTF-8, just set the LANG \
79
+ environment variable to your favorite language.
80
+ Ex. LANG="gl_ES.UTF-8"; cap aptitude:setup
77
81
 
78
82
  See "Update", "locales", "Upgrade" and "build essentials" sections on \
79
83
  http://articles.slicehost.com/2007/11/6/ubuntu-gutsy-setup-page-2
80
84
  DESC
81
85
  task :setup, :roles => :app do
82
86
  update
83
- sudo "locale-gen en_GB.UTF-8"
84
- sudo "/usr/sbin/update-locale LANG=en_GB.UTF-8"
87
+ language = ENV["LANG"] || "en_GB.UTF-8"
88
+ sudo "locale-gen language"
89
+ sudo "/usr/sbin/update-locale LANG=#{language}"
85
90
  safe_upgrade
86
91
  full_upgrade
87
92
  sudo "aptitude install -y build-essential"
@@ -3,4 +3,10 @@ namespace :disk do
3
3
  task :free, :roles => :files do
4
4
  run "df -h /"
5
5
  end
6
+
7
+ desc "Show free memory"
8
+ task :memory, :roles => :files do
9
+ run "free -m"
10
+ end
11
+
6
12
  end
@@ -1,4 +1,17 @@
1
1
  namespace :gems do
2
+ desc "Install the gem package system"
3
+ task :install_rubygems, :roles => :app do
4
+ rubygems_url = "http://rubyforge.org/" + Net::HTTP.get( URI.parse('http://rubyforge.org/frs/?group_id=126') ).scan(/frs\/.*\.tgz/).first.split('"')[0]
5
+ rubygems_version = rubygems_url[/(rubygems.*)(.tgz)/, 1]
6
+ run "test ! -f /usr/bin/gem"
7
+ run "wget -q #{rubygems_url}"
8
+ run "tar xzvf #{rubygems_version}.tgz"
9
+ run "rm #{rubygems_version}.tgz"
10
+ run "cd /home/#{user}/#{rubygems_version} && sudo /usr/bin/ruby ./setup.rb"
11
+ sudo "ln -s /usr/bin/gem1.8 /usr/bin/gem"
12
+ sudo "rm -rf #{rubygems_version}/"
13
+ end
14
+
2
15
  desc "List gems on remote server"
3
16
  task :list, :roles => :app do
4
17
  stream "gem list"
@@ -17,7 +30,7 @@ namespace :gems do
17
30
  desc "Install a gem on the remote server"
18
31
  task :install, :roles => :app do
19
32
  name = Capistrano::CLI.ui.ask("Which gem should we install: ")
20
- sudo "gem install #{name}"
33
+ sudo "gem install #{name} --no-rdoc --no-ri"
21
34
  end
22
35
 
23
36
  desc "Uninstall a gem on the remote server"
@@ -1,8 +1,12 @@
1
- # TODO: Automatically determine these values
2
- set :ruby_enterprise_version, "ruby-enterprise-1.8.6-20080810"
3
- set :passenger_version, "2.0.3"
1
+ # TODO: Automatically determine this value
2
+ set :passenger_version, "2.0.6"
3
+
4
+ require 'net/http'
5
+ set :ruby_enterprise_url ,Net::HTTP.get( 'www.rubyenterpriseedition.com', '/download.html' ).scan(/http:.*\.tar\.gz/).first
6
+ set :ruby_enterprise_version, "#{ruby_enterprise_url[/(ruby-enterprise.*)(.tar.gz)/, 1]}"
4
7
 
5
8
  namespace :ruby do
9
+
6
10
  desc "Install Ruby 1.8"
7
11
  task :setup_18, :roles => :app do
8
12
  sudo "aptitude install -y ruby1.8-dev ruby1.8 ri1.8 rdoc1.8 irb1.8 libreadline-ruby1.8 libruby1.8 libopenssl-ruby sqlite3 libsqlite3-ruby1.8"
@@ -15,8 +19,9 @@ namespace :ruby do
15
19
 
16
20
  desc "Install Ruby Enterpise Edition"
17
21
  task :install_enterprise, :roles => :app do
22
+ sudo "aptitude install -y libssl-dev"
18
23
  run "test ! -d /opt/#{ruby_enterprise_version}"
19
- run "wget -q http://rubyforge.org/frs/download.php/41040/#{ruby_enterprise_version}.tar.gz"
24
+ run "wget -q #{ruby_enterprise_url}"
20
25
  run "tar xzvf #{ruby_enterprise_version}.tar.gz"
21
26
  run "rm #{ruby_enterprise_version}.tar.gz"
22
27
  sudo "./#{ruby_enterprise_version}/installer --auto /opt/#{ruby_enterprise_version}"
@@ -26,11 +31,21 @@ namespace :ruby do
26
31
  desc "Install Phusion Passenger"
27
32
  task :install_passenger, :roles => :app do
28
33
  sudo "apt-get install apache2-mpm-prefork"
29
- sudo "/opt/#{ruby_enterprise_version}/bin/ruby /opt/#{ruby_enterprise_version}/bin/gem install install passenger"
30
- sudo "/opt/#{ruby_enterprise_version}/bin/ruby /opt/#{ruby_enterprise_version}/bin/passenger-install-apache2-module"
34
+ sudo "aptitude install -y apache2-prefork-dev"
35
+ sudo "/opt/#{ruby_enterprise_version}/bin/ruby /opt/#{ruby_enterprise_version}/bin/gem install passenger rake --no-rdoc --no-ri"
36
+ sudo "PATH='/opt/#{ruby_enterprise_version}/bin/':\$PATH /opt/#{ruby_enterprise_version}/bin/ruby /opt/#{ruby_enterprise_version}/bin/passenger-install-apache2-module", :pty => true do |ch, stream, data|
37
+
38
+ if data =~ /Press\sEnter\sto\scontinue/ || data =~ /Press\sENTER\sto\scontinue/
39
+ # prompt, and then send the response to the remote process
40
+ ch.send_data(Capistrano::CLI.password_prompt("Press enter to continue: ") + "\n")
41
+ else
42
+ # use the default handler for all other text
43
+ Capistrano::Configuration.default_io_proc.call(ch, stream, data)
44
+ end
45
+ end
31
46
 
32
47
  put render("passenger.load", binding), "/home/#{user}/passenger.load"
33
- put render("passenger.config", binding), "/home/#{user}/passenger.config"
48
+ put render("passenger.conf", binding), "/home/#{user}/passenger.conf"
34
49
 
35
50
  sudo "mv /home/#{user}/passenger.load /etc/apache2/mods-available/"
36
51
  sudo "mv /home/#{user}/passenger.config /etc/apache2/mods-available/"
@@ -1,4 +1,4 @@
1
- ssh_options = { :keys => [File.expand_path("~/.ssh/id_dsa")], :port => 22 }
1
+ ssh_options = { :keys => [File.expand_path("~/.ssh/id_dsa"),File.expand_path("~/.ssh/id_rsa") ], :port => 22 }
2
2
 
3
3
  namespace :ssh do
4
4
  desc <<-DESC
@@ -32,7 +32,13 @@ namespace :ssh do
32
32
  run "chown -R #{user}:#{user} ~/.ssh"
33
33
  run "chmod 700 ~/.ssh"
34
34
 
35
- authorized_keys = ssh_options[:keys].collect { |key| File.read("#{key}.pub") }.join("\n")
35
+ authorized_keys = ssh_options[:keys].collect { |key|
36
+ begin
37
+ File.read("#{key}.pub")
38
+ rescue Errno::ENOENT => e
39
+ end
40
+
41
+ }.join("\n")
36
42
  put authorized_keys, "./.ssh/authorized_keys", :mode => 0600
37
43
  end
38
44
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: josh-slicehost
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.2.1
4
+ version: 0.0.2.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Joshua Peek
@@ -9,7 +9,7 @@ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
11
 
12
- date: 2008-09-12 00:00:00 -07:00
12
+ date: 2009-01-25 00:00:00 -08:00
13
13
  default_executable:
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
@@ -46,7 +46,7 @@ files:
46
46
  - lib/capistrano/ext/slicehost/iptables.rb
47
47
  - lib/capistrano/ext/slicehost/mysql.rb
48
48
  - lib/capistrano/ext/slicehost/templates
49
- - lib/capistrano/ext/slicehost/templates/passenger.config.erb
49
+ - lib/capistrano/ext/slicehost/templates/passenger.conf.erb
50
50
  - lib/capistrano/ext/slicehost/templates/vhost.erb
51
51
  - lib/capistrano/ext/slicehost/templates/passenger.load.erb
52
52
  - lib/capistrano/ext/slicehost/templates/sshd_config.erb