capserverext 0.0.4 → 0.0.5

Sign up to get free protection for your applications and to get access to all the features.
@@ -1,3 +1,7 @@
1
+ == 0.0.5 / 2007-05-07
2
+
3
+ * Fixes by Jon Egil Strand
4
+
1
5
  == 0.0.4 / 2007-04-18
2
6
 
3
7
  * Fixing mysql db creation method call. Just use base deprec task
@@ -1,3 +1,3 @@
1
1
  class CapistranoServerExtentions
2
- VERSION = '0.0.4'
2
+ VERSION = '0.0.5'
3
3
  end
@@ -42,7 +42,7 @@ Capistrano.configuration(:must_exist).load do
42
42
  }
43
43
 
44
44
  #set the nginx_postgres combination by default
45
- set :deprec_combination, (defined?(deprec_combination) ? deprec_combination : deprec_combinations[:nginx_postgres])
45
+ set :deprec_combination, (defined?(deprec_combination) ? deprec_combination : :nginx_postgres)
46
46
 
47
47
  #set the new non standard port through which ssh communication will happen
48
48
  set :ssh_security_port, (defined?(ssh_security_port) ? ssh_security_port : 8888)
@@ -59,14 +59,13 @@ Capistrano.configuration(:must_exist).load do
59
59
  * Add following entries to deploy.rb:
60
60
 
61
61
  require 'capserverext/recipes'
62
- require 'capistrano/ext/monitor'
63
62
 
64
63
  * Edit deploy.rb appropriately:
65
64
 
66
65
  * set deprec_combination to either (:nginx_postgres, :nginx_mysql, :apache_mysql, :apache_postgres)
67
66
  for a combination other than the default: ':nginx_postgres'
68
67
  e.g
69
- set :deprec_combination, deprec_combinations[:nginx_mysql]
68
+ set :deprec_combination, :nginx_mysql
70
69
  * set ssh_security_port for an ssh port other than the default: '8888'
71
70
  * set mongrel options (best to accept the defaults)
72
71
  * set repository
@@ -89,7 +88,7 @@ Capistrano.configuration(:must_exist).load do
89
88
  #prepare
90
89
  setup_ssh_keys_for_admin_user
91
90
 
92
- deprec_combination.each do |task|
91
+ deprec_combinations[deprec_combination].each do |task|
93
92
  send(task.intern)
94
93
  end
95
94
  end
@@ -5,7 +5,7 @@ Capistrano.configuration(:must_exist).load do
5
5
  desc <<-DESC
6
6
  prints usage
7
7
  DESC
8
- task :postgres_usage do
8
+ task :nginx_usage do
9
9
  puts <<-EOS
10
10
  Apart from any other installations to get nginx setup on your server
11
11
  call the following tasks in order:
@@ -149,14 +149,16 @@ Capistrano.configuration(:must_exist).load do
149
149
  #http://www.nginx.net/CHANGES
150
150
  def find_current_nginx_version
151
151
  version = nil
152
- open('http://www.nginx.net/CHANGES') do |f|
153
- version = f.readline.match(/^Changes\swith\snginx\s([\d\.]+)\s/)[1] rescue nil
154
- end
155
- version ||= '0.5.14'
156
- set :current_nginx_version, version
152
+ begin
153
+ open('http://www.nginx.net/CHANGES') do |f|
154
+ until version do
155
+ version = f.readline.match(/Changes with nginx [\d\.]+/).to_s.split[3]
156
+ end
157
+ end
157
158
  rescue
158
159
  version = '0.5.14'
159
- set :current_nginx_version, version
160
+ end
161
+ set :current_nginx_version, version
160
162
  end
161
163
 
162
164
  end
@@ -5,13 +5,17 @@ Capistrano.configuration(:must_exist).load do
5
5
  desc <<-DESC
6
6
  prints usage
7
7
  DESC
8
- task :nginx_usage do
8
+ task :postgres_usage do
9
9
  puts <<-EOS
10
- Apart from any other installations to get nginx setup on your server
11
- call the following tasks in order:
12
- * cap install_nginx
13
- * cap setup
14
- * cap configure_nginx
10
+ Run the following task to get the latest version
11
+ of postgres installed on your server:
12
+ * cap setup_postgres
13
+
14
+ You can also execute arbitrary sql against the postgres server
15
+ via the following task:
16
+ * execute_postgres
17
+
18
+ Note: Set the 'sql' variable for the sql to be executed.
15
19
  EOS
16
20
  end
17
21
 
@@ -5,7 +5,7 @@ require 'capistrano/cli'
5
5
  module PostgreSQLMethods
6
6
 
7
7
  def execute(sql, user)
8
- run_with_input "echo '#{sql}' | sudo su - #{user} psql"
8
+ run_with_input "echo '#{sql}' | sudo su --login #{user} --command psql"
9
9
  end
10
10
 
11
11
  def handle_postgres_password(user, channel, stream, data)
@@ -26,7 +26,7 @@ Capistrano.configuration(:must_exist).load do
26
26
  desc "Execute PostgreSQL statements using --command option. Set the 'sql' variable."
27
27
  task :execute_postgres, :roles => :db, :only => { :primary => true } do
28
28
  set_postgres_admin
29
- postgresql.execute sql, mysql_admin
29
+ postgresql.execute sql, postgres_admin
30
30
  end
31
31
 
32
32
  desc "Create PostgreSQL database and user based on config/database.yml"
metadata CHANGED
@@ -1,10 +1,10 @@
1
1
  --- !ruby/object:Gem::Specification
2
- rubygems_version: 0.9.0
2
+ rubygems_version: 0.9.2
3
3
  specification_version: 1
4
4
  name: capserverext
5
5
  version: !ruby/object:Gem::Version
6
- version: 0.0.4
7
- date: 2007-04-18 00:00:00 +02:00
6
+ version: 0.0.5
7
+ date: 2007-05-07 00:00:00 +02:00
8
8
  summary: Easily setup postgresql & nginx (http://sysoev.ru/nginx/) on ubuntu hosts.
9
9
  require_paths:
10
10
  - lib