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 +7 -1
- data/instapusher.gemspec +1 -0
- data/lib/instapusher.rb +2 -1
- data/lib/instapusher/command_builder.rb +2 -0
- data/lib/instapusher/commands.rb +30 -1
- data/lib/instapusher/configuration.rb +1 -0
- data/lib/instapusher/executor.rb +1 -0
- data/lib/instapusher/version.rb +1 -1
- metadata +20 -4
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
|
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
data/lib/instapusher.rb
CHANGED
data/lib/instapusher/commands.rb
CHANGED
@@ -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
|
|
data/lib/instapusher/executor.rb
CHANGED
data/lib/instapusher/version.rb
CHANGED
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.
|
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-
|
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:
|
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:
|
109
|
+
hash: 816964511035073800
|
94
110
|
requirements: []
|
95
111
|
rubyforge_project:
|
96
112
|
rubygems_version: 1.8.23
|