capistrano_auto_multi_install 1.0.3 → 1.0.4
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.
@@ -23,6 +23,25 @@ DEFAULT COLLATE utf8_general_ci;'")
|
|
23
23
|
log "Database done"
|
24
24
|
end
|
25
25
|
|
26
|
+
def create_database_yml_file
|
27
|
+
|
28
|
+
mysql_password = fetch(:mysql_user_password)
|
29
|
+
mysql_user = fetch(:mysql_user)
|
30
|
+
|
31
|
+
conf = ERB.new(File.read(File.dirname(__FILE__)+"/database.yml.erb")).result(binding)
|
32
|
+
run_with_power "mkdir -p #{fetch(:shared_path)}/db", fetch(:runner)
|
33
|
+
run_with_power "mkdir -p #{fetch(:shared_path)}/config", fetch(:runner)
|
34
|
+
put_with_power conf, "#{fetch(:shared_path)}/config/database.yml", fetch(:runner)
|
35
|
+
|
36
|
+
syslink
|
37
|
+
end
|
38
|
+
|
39
|
+
def syslink
|
40
|
+
run_with_power "ln -nfs #{fetch(:shared_path)}/config/database.yml #{fetch(:current_path)}/config/database.yml", fetch(:runner)
|
41
|
+
end
|
42
|
+
|
43
|
+
|
44
|
+
|
26
45
|
def check_or_create_user
|
27
46
|
log 'Checking if '+fetch(:mysql_user)+' has already been created and granted correctly'
|
28
47
|
log 'Errors messages reporting a missing user can be safely ignored'
|
@@ -64,23 +83,6 @@ DEFAULT COLLATE utf8_general_ci;'")
|
|
64
83
|
create_database_yml_file
|
65
84
|
end
|
66
85
|
|
67
|
-
def create_database_yml_file
|
68
|
-
|
69
|
-
mysql_password = fetch(:mysql_user_password)
|
70
|
-
mysql_user = fetch(:mysql_user)
|
71
|
-
|
72
|
-
conf = ERB.new(File.read(File.dirname(__FILE__)+"/database.yml.erb")).result(binding)
|
73
|
-
run_with_power "mkdir -p #{fetch(:shared_path)}/db", fetch(:runner)
|
74
|
-
run_with_power "mkdir -p #{fetch(:shared_path)}/config", fetch(:runner)
|
75
|
-
put_with_power conf, "#{fetch(:shared_path)}/config/database.yml", fetch(:runner)
|
76
|
-
|
77
|
-
syslink
|
78
|
-
end
|
79
|
-
|
80
|
-
def syslink
|
81
|
-
run_with_power "ln -nfs #{fetch(:shared_path)}/config/database.yml #{fetch(:current_path)}/config/database.yml", fetch(:runner)
|
82
|
-
end
|
83
|
-
|
84
86
|
private
|
85
87
|
|
86
88
|
def capture_as_admin command, string_to_add=''
|
@@ -1,9 +1,9 @@
|
|
1
|
-
port:
|
2
|
-
cwd: "
|
1
|
+
port: <%=port%>
|
2
|
+
cwd: "<%=base_directory}%>"
|
3
3
|
log_file: log/mongrel
|
4
4
|
environment: production
|
5
5
|
address: 127.0.0.1
|
6
6
|
pid_file: log/mongrel.pid
|
7
|
-
servers
|
7
|
+
servers <%=number_of_instances%>
|
8
8
|
docroot: public
|
9
|
-
user:
|
9
|
+
user: "<%=web_user%>"
|