kapify 0.1.0 → 0.1.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/kapify/pg/configuration.rb +13 -11
- data/lib/kapify/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 4fa1a22a78a5dedb8bbfbccb55daae3f36cd3ba0
|
4
|
+
data.tar.gz: a461dca9aba4e0f59380a0beaf5cb508dca7286f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 1597cf5812c9f3c59fe60aec5456b12eee59e0833f92d11c356128fc70f360383f57335334a9b3fe2631a89ee20ef6e035ab985585957dbeee0b4f96e7563aae
|
7
|
+
data.tar.gz: 57f05d0fc0d9ff06d87b1f3bf5036c0e1973c0c6381301523e0aefeda7fc6673ace23b181f21cbb976bf53c6a892fd3eb731b1427b62e17e821f10f34a672bc5
|
@@ -14,24 +14,26 @@ Capistrano::Configuration.instance.load do
|
|
14
14
|
namespace :pg do
|
15
15
|
desc "Create user for application"
|
16
16
|
task :create_user, roles: :pg do
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
17
|
+
if find_servers(roles: :pg).size > 0
|
18
|
+
pg_params = "-p #{pg_port}"
|
19
|
+
check_user = %Q[#{sudo} -u postgres psql #{pg_params} postgres -c "select * from pg_user where usename='#{pg_user}'" | grep -c '#{pg_user}']
|
20
|
+
add_user = %Q[#{sudo} su postgres -c "createuser -SREd #{pg_params} #{pg_user}"]
|
21
|
+
run "#{check_user} || #{add_user}"
|
22
|
+
run %Q{#{sudo} -u postgres psql #{pg_params} -c "alter user #{pg_user} with password '#{pg_password}'" }
|
23
|
+
end
|
22
24
|
end
|
23
25
|
|
24
26
|
desc "Create database for application"
|
25
27
|
task :create_database, roles: :pg do
|
26
|
-
if
|
27
|
-
|
28
|
+
if find_servers(roles: :pg).size > 0
|
29
|
+
if pg_create_db
|
30
|
+
run %Q{#{sudo} -u postgres psql -c "create database #{pg_database} owner #{pg_user};"}
|
31
|
+
end
|
28
32
|
end
|
29
33
|
end
|
30
34
|
|
31
|
-
|
32
|
-
|
33
|
-
after "deploy:setup", "kapify:pg:create_database"
|
34
|
-
end
|
35
|
+
after "deploy:setup", "kapify:pg:create_user"
|
36
|
+
after "deploy:setup", "kapify:pg:create_database"
|
35
37
|
|
36
38
|
desc "Generate the database.yml configuration file."
|
37
39
|
task :setup, roles: [:app, :resque_worker] do
|
data/lib/kapify/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: kapify
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Ivan Tkalin
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2013-08-
|
11
|
+
date: 2013-08-30 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: capistrano
|