instapusher 0.0.21 → 0.0.22

Sign up to get free protection for your applications and to get access to all the features.
data/README.md CHANGED
@@ -27,10 +27,16 @@ You can provide the env variable `LOCAL` like:
27
27
 
28
28
  instapusher --local
29
29
 
30
- To enable debug messages you can do
30
+ To enable debug messages do
31
31
 
32
32
  instapusher --debug
33
33
 
34
+ Enable quick option as shown below. In the quick mode only code is
35
+ pushed. No migration is done. No config environment is set. So it is
36
+ much faster and it leaves the data intact.
37
+
38
+ instapusher --quick
39
+
34
40
  Pass host info like this
35
41
 
36
42
  INSTAPUSHER_HOST=instapusher.com instapusher
data/instapusher.gemspec CHANGED
@@ -17,4 +17,5 @@ Gem::Specification.new do |gem|
17
17
 
18
18
  gem.add_dependency("hashr", "~> 0.0.19")
19
19
  gem.add_dependency("json")
20
+ gem.add_dependency("activesupport")
20
21
  end
data/lib/instapusher.rb CHANGED
@@ -1,7 +1,8 @@
1
1
  require 'instapusher/git'
2
2
  require 'instapusher/configuration'
3
+ require 'activesupport/all'
3
4
 
4
5
  module Instapusher
5
6
  end
6
7
 
7
- Instapusher::Configuration.load
8
+ Instapusher::Configuration.load
@@ -9,6 +9,8 @@ module Instapusher
9
9
  delegate :job, to: :base
10
10
 
11
11
  def initialize base
12
+ raise 'boom'
13
+
12
14
  @base = base
13
15
  @commands = []
14
16
  end
@@ -2,6 +2,7 @@ require 'net/http'
2
2
  require 'uri'
3
3
  require 'multi_json'
4
4
  require 'instapusher'
5
+ require 'active_support/all'
5
6
 
6
7
  module Instapusher
7
8
  class Commands
@@ -11,7 +12,6 @@ module Instapusher
11
12
  attr_reader :debug, :api_key, :branch_name, :project_name
12
13
 
13
14
  def initialize init_options = {}
14
-
15
15
  @debug = init_options[:debug]
16
16
  @quick = init_options[:quick]
17
17
  @local = init_options[:local]
@@ -50,14 +50,43 @@ module Instapusher
50
50
  end
51
51
  end
52
52
 
53
+ def special_instructions_for_production
54
+ question = "You are deploying to production. Did you take backup? If not then execute rake handy:heroku:backup_production and then come back. "
55
+ STDOUT.puts question
56
+ STDOUT.puts "Answer 'yes' or 'no' "
57
+
58
+ input = STDIN.gets.chomp.downcase
59
+
60
+ if %w(yes y).include?(input)
61
+ elsif %w(no n).include?(input)
62
+ abort "Please try again when you have taken the backup"
63
+ else
64
+ abort "Please answer yes or no"
65
+ end
66
+
67
+ version_number = Time.current.to_s.parameterize
68
+
69
+
70
+ cmd = "git tag -a -m \"Version #{version_number}\" #{version_number}"
71
+ puts cmd if debug
72
+ system cmd
73
+
74
+ cmd = "git push --tags"
75
+ puts cmd if debug
76
+ system cmd
77
+ end
78
+
53
79
  def deploy
54
80
  verify_api_key
81
+ special_instructions_for_production if branch_name.intern == :production
55
82
 
56
83
  if debug
57
84
  puts "url to hit: #{url.inspect}"
58
85
  puts "options being passed to the url: #{options.inspect}"
86
+ puts "connecting to #{url} to send data"
59
87
  end
60
88
 
89
+
61
90
  response = Net::HTTP.post_form URI.parse(url), options
62
91
  response_body = MultiJson.load(response.body)
63
92
 
@@ -3,6 +3,7 @@ require 'yaml'
3
3
  module Instapusher
4
4
  module Configuration
5
5
  extend self
6
+ raise 'boom'
6
7
 
7
8
  @_settings = {}
8
9
  attr_reader :_settings
@@ -6,6 +6,7 @@ module Instapusher
6
6
  delegate :job, to: :base
7
7
 
8
8
  def initialize base
9
+ raise 'boom'
9
10
  @base = base
10
11
  end
11
12
 
@@ -1,3 +1,3 @@
1
1
  module Instapusher
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: instapusher
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-20 00:00:00.000000000 Z
12
+ date: 2013-05-24 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: hashr
@@ -43,6 +43,22 @@ dependencies:
43
43
  - - ! '>='
44
44
  - !ruby/object:Gem::Version
45
45
  version: '0'
46
+ - !ruby/object:Gem::Dependency
47
+ name: activesupport
48
+ requirement: !ruby/object:Gem::Requirement
49
+ none: false
50
+ requirements:
51
+ - - ! '>='
52
+ - !ruby/object:Gem::Version
53
+ version: '0'
54
+ type: :runtime
55
+ prerelease: false
56
+ version_requirements: !ruby/object:Gem::Requirement
57
+ none: false
58
+ requirements:
59
+ - - ! '>='
60
+ - !ruby/object:Gem::Version
61
+ version: '0'
46
62
  description: instapusher makes it easy to push code to heroku
47
63
  email:
48
64
  - neeraj@bigbinary.com
@@ -81,7 +97,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
81
97
  version: '0'
82
98
  segments:
83
99
  - 0
84
- hash: 1457964422247029957
100
+ hash: 816964511035073800
85
101
  required_rubygems_version: !ruby/object:Gem::Requirement
86
102
  none: false
87
103
  requirements:
@@ -90,7 +106,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
90
106
  version: '0'
91
107
  segments:
92
108
  - 0
93
- hash: 1457964422247029957
109
+ hash: 816964511035073800
94
110
  requirements: []
95
111
  rubyforge_project:
96
112
  rubygems_version: 1.8.23