instapusher 0.0.29 → 0.0.30
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/instapusher/job_submission.rb +41 -39
- data/lib/instapusher/tag_the_release.rb +17 -15
- data/lib/instapusher/version.rb +1 -1
- data/lib/instapusher.rb +3 -0
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 5c057c5f47fcd5fb412ebc03fafc6e6cb33fe4bc
|
4
|
+
data.tar.gz: f790807c4dbeea8066c21fbcdb4d98e4c5dcf957
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: fda59d795317ace3829f1d76843ac62227224f32b8226b4d7495fe9cf016cbc35f60c4dca76bc217a5f430c21b053d40cf7eb5774e5d48ccc2124bd4a8fb6a45
|
7
|
+
data.tar.gz: ab5582d90c1c85740455ce73f3ff75db5da633aee8b213c46d58658d946c4543d175e7a160d83c53999a183f99fb484a0968bbc885f2d1d11e90abed500f11df
|
@@ -1,52 +1,54 @@
|
|
1
|
-
|
1
|
+
module Instapusher
|
2
|
+
class JobSubmission
|
2
3
|
|
3
|
-
|
4
|
+
attr_reader :options, :debug, :job_status_url
|
4
5
|
|
5
|
-
|
6
|
+
DEFAULT_HOSTNAME = 'instapusher.com'
|
6
7
|
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
8
|
+
def initialize debug, options
|
9
|
+
@debug = debug
|
10
|
+
@options = options
|
11
|
+
end
|
11
12
|
|
12
|
-
|
13
|
-
|
14
|
-
|
13
|
+
def success?
|
14
|
+
job_status_url && job_status_url != ""
|
15
|
+
end
|
15
16
|
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
17
|
+
def pre_submission_feedback_to_user
|
18
|
+
puts "url to hit: #{url_to_submit_job.inspect}"
|
19
|
+
puts "options being passed to the url: #{options.inspect}"
|
20
|
+
puts "connecting to #{url_to_submit_job} to send data"
|
21
|
+
end
|
21
22
|
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
23
|
+
def feedback_to_user
|
24
|
+
puts 'The appliction will be deployed to: ' + response_body['heroku_url']
|
25
|
+
puts 'Monitor the job status at: ' + job_status_url
|
26
|
+
cmd = "open #{job_status_url}"
|
27
|
+
`#{cmd}`
|
28
|
+
end
|
28
29
|
|
29
|
-
|
30
|
-
|
31
|
-
|
30
|
+
def error_message
|
31
|
+
response_body['error']
|
32
|
+
end
|
32
33
|
|
33
|
-
|
34
|
-
|
34
|
+
def submit_the_job
|
35
|
+
pre_submission_feedback_to_user if debug
|
35
36
|
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
37
|
+
response = Net::HTTP.post_form URI.parse(url_to_submit_job), options
|
38
|
+
@response_body = ::JSON.parse(response.body)
|
39
|
+
puts "response_body: #{response_body.inspect}" if debug
|
40
|
+
@job_status_url = response_body['status'] || response_body['job_status_url']
|
41
|
+
end
|
41
42
|
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
43
|
+
def url_to_submit_job
|
44
|
+
@url ||= begin
|
45
|
+
hostname = if options[:local]
|
46
|
+
"localhost:3000"
|
47
|
+
else
|
48
|
+
ENV['INSTAPUSHER_HOST'] || DEFAULT_HOSTNAME
|
49
|
+
end
|
50
|
+
"http://#{hostname}/heroku.json"
|
51
|
+
end
|
50
52
|
end
|
51
53
|
end
|
52
54
|
end
|
@@ -1,21 +1,23 @@
|
|
1
|
-
|
1
|
+
module Instapusher
|
2
|
+
class TagTheRelease
|
2
3
|
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
4
|
+
def initialize branch_name, debug
|
5
|
+
@branch_name = branch_name
|
6
|
+
@debug = debug
|
7
|
+
end
|
7
8
|
|
8
|
-
|
9
|
-
|
10
|
-
|
9
|
+
def tagit
|
10
|
+
version_number = Time.current.to_s.parameterize
|
11
|
+
tag_name = "#{branch_name}-#{version_number}"
|
11
12
|
|
12
|
-
|
13
|
-
|
14
|
-
|
13
|
+
cmd = "git tag -a -m \"Version #{tag_name}\" #{tag_name}"
|
14
|
+
puts cmd if debug
|
15
|
+
system cmd
|
15
16
|
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
17
|
+
cmd = "git push --tags"
|
18
|
+
puts cmd if debug
|
19
|
+
system cmd
|
20
|
+
end
|
20
21
|
|
22
|
+
end
|
21
23
|
end
|
data/lib/instapusher/version.rb
CHANGED
data/lib/instapusher.rb
CHANGED
@@ -2,6 +2,9 @@ require_relative './instapusher/git'
|
|
2
2
|
require_relative './instapusher/commands'
|
3
3
|
require_relative './instapusher/version'
|
4
4
|
require_relative './instapusher/configuration'
|
5
|
+
require_relative './instapusher/job_submission'
|
6
|
+
require_relative './instapusher/special_instruction_for_production'
|
7
|
+
require_relative './instapusher/tag_the_release'
|
5
8
|
require 'active_support/all'
|
6
9
|
require 'json'
|
7
10
|
|