wcc-base 0.1.3 → 0.2.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/tasks/db/psql.rake +21 -8
- data/lib/wcc/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: 25e00dba3489248a44d4207066b5fa01991e3fa6
|
4
|
+
data.tar.gz: f103d41dfe6881cc08b817327b431a55f3f95a04
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b629f11aee75a8c05f5791fd5ef300d947a492a63ee8cdfff22601257e36cc379d0baf7c25c93ecdb4dfa227fa4d5f1398bb6ea731f539e6adb988dfe978b905
|
7
|
+
data.tar.gz: ef9bc249289288925605192504840dd259c46537abf608a8018b3d39c503c16be69b6874f5a9b09a64407b2cf44d351b79f5dd289e59c9df3e77dc8816e9be9c
|
data/lib/tasks/db/psql.rake
CHANGED
@@ -32,14 +32,27 @@ namespace :db do
|
|
32
32
|
task :restore, :file do |t, args|
|
33
33
|
raise "file argument required" unless File.exists?(args[:file])
|
34
34
|
db_config = WCC::RakeHelpers.db_config
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
35
|
+
case File.extname(args[:file])
|
36
|
+
when ".sql"
|
37
|
+
command = [
|
38
|
+
"cat #{args[:file]} |",
|
39
|
+
WCC::RakeHelpers.db_cmd_with_password_string(["psql"], db_config['password']),
|
40
|
+
db_config['username'] ? "--username=#{db_config['username']}" : nil,
|
41
|
+
db_config['host'] ? "--host=#{db_config['host']}" : nil,
|
42
|
+
db_config['database'],
|
43
|
+
].compact.join(" ")
|
44
|
+
`#{command}`
|
45
|
+
when ".dump"
|
46
|
+
command = [
|
47
|
+
"pg_restore",
|
48
|
+
"--verbose", "--clean", "--no-acl", "--no-owner",
|
49
|
+
db_config['username'] ? ["-U", db_config['username']] : nil,
|
50
|
+
db_config['host'] ? ["-h", db_config['host']] : nil,
|
51
|
+
"-d", db_config['database'],
|
52
|
+
args[:file]
|
53
|
+
].flatten.compact
|
54
|
+
system(*command)
|
55
|
+
end
|
43
56
|
Rake::Task['db:after_restore'].invoke(args[:file])
|
44
57
|
end
|
45
58
|
|
data/lib/wcc/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: wcc-base
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.2.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Watermark Community Church
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2017-
|
11
|
+
date: 2017-03-10 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|