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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 5693bfd53c3f283033d04ee1eaddff7f698d0c53
4
- data.tar.gz: 9f4a300def8ced2aff5a1c9c228df894330c5211
3
+ metadata.gz: 4fa1a22a78a5dedb8bbfbccb55daae3f36cd3ba0
4
+ data.tar.gz: a461dca9aba4e0f59380a0beaf5cb508dca7286f
5
5
  SHA512:
6
- metadata.gz: 7f6c274cc6d57b73ec893b7f963b2063917ade046b33ed81d30ae9c43e9cc6bd9d97de6d46be81ea7f3ac135b07ebff4c96e6355221b9d78c086bc0387da8d05
7
- data.tar.gz: 6b5637abb3bc30ad1f4e3324011f5ae3ad215ab1752900753fd5fc3a7ffa40b827722faf0b3b5993300dbaf60615a27597ea9da3bc3ea779423493dd2d79d12a
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
- pg_params = "-p #{pg_port}"
18
- check_user = %Q[#{sudo} -u postgres psql #{pg_params} postgres -c "select * from pg_user where usename='#{pg_user}'" | grep -c '#{pg_user}']
19
- add_user = %Q[#{sudo} -u postgres psql #{pg_params} -c "create user #{pg_user}"]
20
- run "#{check_user} || #{add_user}"
21
- run %Q{#{sudo} -u postgres psql #{pg_params} -c "alter user #{pg_user} with password '#{pg_password}'" }
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 pg_create_db
27
- run %Q{#{sudo} -u postgres psql -c "create database #{pg_database} owner #{pg_user};"}
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
- if find_servers(roles: :pg).size > 0
32
- after "deploy:setup", "kapify:pg:create_user"
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
@@ -1,3 +1,3 @@
1
1
  module Kapify
2
- VERSION = "0.1.0"
2
+ VERSION = "0.1.1"
3
3
  end
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.0
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-07 00:00:00.000000000 Z
11
+ date: 2013-08-30 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: capistrano