filbert 0.1.1 → 0.2.0
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.
- checksums.yaml +4 -4
- data/lib/filbert/task.rb +14 -9
- data/lib/filbert/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: af40fbd2f9752c34a940cba11f11281ce1eab928
|
4
|
+
data.tar.gz: c612f5ac93130dd14b5d5fe1fa2ff9b156261b7c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 138c35bedb932db44815d77cc7cd2e9d2c565307e0451526317b208dcc26428b9b5743e48b399b54b93ff2c21eb426a5df4bba31eaac0f16f20977dd0eb85a99
|
7
|
+
data.tar.gz: 522e3d371a25989d905c30fbc6bcb4c85e2bc48c38e6fc182f2c91b849e590febb28a15381f466f035dd042b17db11fae932901495038c5f0e0240dff4bfeea4
|
data/lib/filbert/task.rb
CHANGED
@@ -11,17 +11,22 @@ module Filbert
|
|
11
11
|
desc "backup", "capture and pull latest production snapshot and migrate local database"
|
12
12
|
def backup
|
13
13
|
say "Looking for the follower DB..."
|
14
|
-
db_name = run!("heroku pg:info --app #{options[:app]} | grep Followers | awk '
|
14
|
+
db_name = run!("heroku pg:info --app #{options[:app]} | grep -A 1 Followers | awk 'NR==2'").strip
|
15
15
|
say "Found the follower: #{db_name}. Capturing..."
|
16
16
|
backup_id = run!("heroku pgbackups:capture #{db_name} --expire --app #{options[:app]} | grep backup | awk '/--->/ { print $3}'").strip
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
17
|
+
if backup_id != "error"
|
18
|
+
say "Backup id: #{backup_id}"
|
19
|
+
say "Fetching backup S3 URL"
|
20
|
+
backup_url = run!("heroku pgbackups:url #{backup_id} --app #{options[:app]} ").strip.gsub("\"", "")
|
21
|
+
say "Downloading #{backup_url}"
|
22
|
+
get backup_url, file_path
|
23
|
+
say file_path
|
24
|
+
Log.new(:backup, db_name, options[:log]).success if File.exists?(file_path) && options[:log]
|
25
|
+
invoke :cleanup, [], {}
|
26
|
+
else
|
27
|
+
say "Error capturing #{db_name}. Run `heroku pgbackups --app #{options[:app]}` to see if there are any transfers in progress."
|
28
|
+
exit! 1
|
29
|
+
end
|
25
30
|
end
|
26
31
|
|
27
32
|
method_option :pretend, type: :boolean, required: false, default: false, aliases: '-p'
|
data/lib/filbert/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: filbert
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.2.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Tadas Tamosauskas
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2013-
|
11
|
+
date: 2013-09-10 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: heroku
|