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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 107e006aeae846d31d72fec4789b8339a205c877
4
- data.tar.gz: 99fb86b7a668faa414a48bc677799b89d3c62f39
3
+ metadata.gz: af40fbd2f9752c34a940cba11f11281ce1eab928
4
+ data.tar.gz: c612f5ac93130dd14b5d5fe1fa2ff9b156261b7c
5
5
  SHA512:
6
- metadata.gz: 07b733ef41d170e670dcd3496847fe986fc7f9f8b4db270c97b97ed861ada1a4c76f3edafa8b4c0e8ea66fce47d9e3b2fb7db79cfc35d22a7d420f8512eb2544
7
- data.tar.gz: 8780c99d3e3e20788e19121ac85634e340c0a344ad8379b2ae50dddcc42447a4af73c2e08c9a674c57d5ecb7c5ee075e5c96c5362ccaab16119c4d7b5d849939
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 '/:(.)*/ { print $2 }'").strip
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
- say "Backup id: #{backup_id}"
18
- say "Fetching backup S3 URL"
19
- backup_url = run!("heroku pgbackups:url #{backup_id} --app #{options[:app]} ").strip.gsub("\"", "")
20
- say "Downloading #{backup_url}"
21
- get backup_url, file_path
22
- say file_path
23
- Log.new(:backup, db_name, options[:log]).success if File.exists?(file_path) && options[:log]
24
- invoke :cleanup, [], {}
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'
@@ -1,3 +1,3 @@
1
1
  module Filbert
2
- VERSION = '0.1.1'
2
+ VERSION = '0.2.0'
3
3
  end
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.1.1
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-07-05 00:00:00.000000000 Z
11
+ date: 2013-09-10 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: heroku