capserverext 0.0.4 → 0.0.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/History.txt +4 -0
- data/lib/cap_server_ext.rb +1 -1
- data/lib/capserverext/recipes.rb +3 -4
- data/lib/nginx/recipes.rb +1 -1
- data/lib/nginx/recipes/nginx.rb +8 -6
- data/lib/postgres/recipes.rb +10 -6
- data/lib/postgres/recipes/postgres.rb +2 -2
- metadata +3 -3
data/History.txt
CHANGED
data/lib/cap_server_ext.rb
CHANGED
data/lib/capserverext/recipes.rb
CHANGED
@@ -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 :
|
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,
|
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
|
data/lib/nginx/recipes.rb
CHANGED
data/lib/nginx/recipes/nginx.rb
CHANGED
@@ -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
|
-
|
153
|
-
|
154
|
-
|
155
|
-
|
156
|
-
|
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
|
-
|
160
|
+
end
|
161
|
+
set :current_nginx_version, version
|
160
162
|
end
|
161
163
|
|
162
164
|
end
|
data/lib/postgres/recipes.rb
CHANGED
@@ -5,13 +5,17 @@ Capistrano.configuration(:must_exist).load do
|
|
5
5
|
desc <<-DESC
|
6
6
|
prints usage
|
7
7
|
DESC
|
8
|
-
task :
|
8
|
+
task :postgres_usage do
|
9
9
|
puts <<-EOS
|
10
|
-
|
11
|
-
|
12
|
-
* cap
|
13
|
-
|
14
|
-
|
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
|
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,
|
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.
|
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.
|
7
|
-
date: 2007-
|
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
|