handy 0.0.21 → 0.0.22

Sign up to get free protection for your applications and to get access to all the features.
@@ -34,6 +34,32 @@ namespace :handy do
34
34
  execute "heroku pgbackups:restore DATABASE #{get_src_db_url_cmd} --app #{dst_app_name} --confirm #{dst_app_name}"
35
35
  end
36
36
 
37
+ desc "Takes snapshot of branch A and pushes to branch B"
38
+ task :a2b, :app do |t, args|
39
+ a = ENV['A'] || ENV['a']
40
+ b = ENV['B'] || ENV['b']
41
+
42
+ if a.nil?
43
+ puts "A was not supplied"
44
+ puts "Usage: rake handy:heroku:a2b A=production B=533-home-page-design--ip"
45
+ exit 1
46
+ end
47
+
48
+ if b.nil?
49
+ puts "B was not supplied"
50
+ puts "Usage: rake handy:heroku:a2b A=production B=533-home-page-design--ip"
51
+ exit 1
52
+ end
53
+
54
+ take_current_snapshot "#{heroku_app_name(t, args)}-#{a}"
55
+
56
+ heroku_app_name = heroku_app_name(t, args)
57
+ src_app_name = "#{heroku_app_name}-#{a}"
58
+ dst_app_name = "#{heroku_app_name}-#{b}"
59
+
60
+ get_src_db_url_cmd = "`heroku pgbackups:url --app #{src_app_name}`"
61
+ execute "heroku pgbackups:restore DATABASE #{get_src_db_url_cmd} --app #{dst_app_name} --confirm #{dst_app_name}"
62
+ end
37
63
 
38
64
  def export2local(app_name)
39
65
  take_current_snapshot(app_name)
data/lib/handy/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Handy
2
- VERSION = "0.0.21"
2
+ VERSION = "0.0.22"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: handy
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.21
4
+ version: 0.0.22
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2013-05-24 00:00:00.000000000 Z
12
+ date: 2013-09-13 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: hashr
@@ -62,7 +62,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
62
62
  version: '0'
63
63
  segments:
64
64
  - 0
65
- hash: -3234754143650769469
65
+ hash: 4596920742940519601
66
66
  required_rubygems_version: !ruby/object:Gem::Requirement
67
67
  none: false
68
68
  requirements:
@@ -71,7 +71,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
71
71
  version: '0'
72
72
  segments:
73
73
  - 0
74
- hash: -3234754143650769469
74
+ hash: 4596920742940519601
75
75
  requirements: []
76
76
  rubyforge_project:
77
77
  rubygems_version: 1.8.23