blanket 0.0.2 → 0.0.3
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/lib/blanket/init.rb
CHANGED
@@ -20,4 +20,5 @@ require File.dirname(__FILE__) + "/plugins/sources/mysql.rb"
|
|
20
20
|
require File.dirname(__FILE__) + "/plugins/sources/subversion.rb"
|
21
21
|
require File.dirname(__FILE__) + "/plugins/sources/single_file.rb"
|
22
22
|
require File.dirname(__FILE__) + "/plugins/sources/remote_directory.rb"
|
23
|
+
require File.dirname(__FILE__) + "/plugins/sources/postgresql.rb"
|
23
24
|
require File.dirname(__FILE__) + "/plugins/sinks/s3.rb"
|
@@ -6,7 +6,7 @@ class Mysql < Source
|
|
6
6
|
end
|
7
7
|
|
8
8
|
def self.attribute_symbols
|
9
|
-
[:source_type, :host, :
|
9
|
+
[:source_type, :host, :user, :db_user, :password,
|
10
10
|
:db_password, :database, :dump_options, :remote_path, :local_path ]
|
11
11
|
end
|
12
12
|
|
@@ -18,7 +18,7 @@ class Mysql < Source
|
|
18
18
|
"yourhost.com"
|
19
19
|
end
|
20
20
|
|
21
|
-
def self.
|
21
|
+
def self.default_user
|
22
22
|
"username"
|
23
23
|
end
|
24
24
|
|
@@ -0,0 +1,69 @@
|
|
1
|
+
require 'date'
|
2
|
+
class Postgresql < Source
|
3
|
+
|
4
|
+
def initialize(reader)
|
5
|
+
@reader = reader
|
6
|
+
end
|
7
|
+
|
8
|
+
def self.attribute_symbols
|
9
|
+
[:source_type, :host, :user, :password, :db_user, :db_host,
|
10
|
+
:database, :dump_options, :remote_path, :local_path]
|
11
|
+
end
|
12
|
+
|
13
|
+
def self.default_source_type
|
14
|
+
"Postgresql"
|
15
|
+
end
|
16
|
+
|
17
|
+
def self.default_host
|
18
|
+
"yourhost.com"
|
19
|
+
end
|
20
|
+
|
21
|
+
def self.default_user
|
22
|
+
"username"
|
23
|
+
end
|
24
|
+
|
25
|
+
def self.default_db_user
|
26
|
+
"username"
|
27
|
+
end
|
28
|
+
|
29
|
+
def self.default_password
|
30
|
+
"password"
|
31
|
+
end
|
32
|
+
|
33
|
+
def self.default_db_host
|
34
|
+
"127.0.0.1"
|
35
|
+
end
|
36
|
+
|
37
|
+
def self.default_database
|
38
|
+
"test"
|
39
|
+
end
|
40
|
+
|
41
|
+
def self.default_remote_path
|
42
|
+
"/path/to/remote/sql-file"
|
43
|
+
end
|
44
|
+
|
45
|
+
def self.default_local_path
|
46
|
+
"/path/to/local/sql-file"
|
47
|
+
end
|
48
|
+
|
49
|
+
def self.default_dump_options
|
50
|
+
"--format=custom"
|
51
|
+
end
|
52
|
+
|
53
|
+
def remote_backup_path
|
54
|
+
remote_path
|
55
|
+
end
|
56
|
+
|
57
|
+
def local_backup_path
|
58
|
+
local_path
|
59
|
+
end
|
60
|
+
|
61
|
+
def prep_command
|
62
|
+
"pg_dump #{dump_options} -U #{db_user} -h #{db_host} #{database} > #{remote_backup_path}"
|
63
|
+
end
|
64
|
+
|
65
|
+
def cleanup_command
|
66
|
+
noop
|
67
|
+
end
|
68
|
+
|
69
|
+
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: blanket
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Jim Van Fleet
|
@@ -63,6 +63,7 @@ files:
|
|
63
63
|
- lib/blanket/plugins/sources/subversion.rb
|
64
64
|
- lib/blanket/plugins/sources/single_file.rb
|
65
65
|
- lib/blanket/plugins/sources/remote_directory.rb
|
66
|
+
- lib/blanket/plugins/sources/postgresql.rb
|
66
67
|
- lib/blanket/plugins/sinks/s3.rb
|
67
68
|
- spec/fixtures
|
68
69
|
- spec/confluence_spec.rb
|