instapusher 0.0.34 → 0.1.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 +4 -4
- data/README.md +19 -25
- data/{instapusher.gemspec → instapusher2.gemspec} +0 -0
- data/lib/instapusher/commands.rb +12 -8
- data/lib/instapusher/configuration.rb +7 -2
- data/lib/instapusher/job_submission.rb +3 -3
- data/lib/instapusher/version.rb +1 -1
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 0000410ddbf37ac304f869cbcd58b2653fed4fab
|
4
|
+
data.tar.gz: 9c8a6d23f2bd2ce5eb996b32a78ec3897a672ba3
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: be31597850685a59a1a9457be8e2929cda5b2ea8636e13c9f7ab3dda8e46097c7c69c9e96523d61c430e6c78c2ef4fcc58698e12184a91ec36ac1b65d9031155
|
7
|
+
data.tar.gz: 33b6659eb43856145493df8e1447ed7b437b144524e0adaad7bbee068abd8eee3fc8965cea6986774bf6d68d8548c7522a09926525bc8623ab31ce3366154f13
|
data/README.md
CHANGED
@@ -9,17 +9,33 @@ Makes it easy to push to heroku.
|
|
9
9
|
## Setting up account
|
10
10
|
|
11
11
|
* Login at instapusher.com .
|
12
|
-
*
|
12
|
+
* Execute `instapusher --api-key` on local machine .
|
13
13
|
|
14
14
|
## Usage
|
15
15
|
|
16
16
|
In order to deploy your code first make sure that you are in the branch that you want to deploy.
|
17
17
|
Then execute this command.
|
18
18
|
|
19
|
-
|
19
|
+
```
|
20
|
+
instapusher
|
21
|
+
```
|
20
22
|
|
21
23
|
It detects project name and a branch from the git repo and starts deploying your project.
|
22
24
|
|
25
|
+
### Running background jobs and other rake tasks
|
26
|
+
|
27
|
+
Instapusher does not create workers on heroku for your project.
|
28
|
+
Background jobs or rake tasks should be run manually from the console.
|
29
|
+
|
30
|
+
``` sh
|
31
|
+
heroku run rake <TASK_NAME> --app <APP_NAME_GIVEN_BY_INSTAPUSHER>
|
32
|
+
```
|
33
|
+
|
34
|
+
For eg. to run delayed job workers
|
35
|
+
|
36
|
+
``` sh
|
37
|
+
heroku run rake jobs:work --app my-awesome-app-42-add-devise-authentication-ip
|
38
|
+
```
|
23
39
|
|
24
40
|
## Setup Instapusher server
|
25
41
|
|
@@ -31,12 +47,6 @@ To enable debug messages do
|
|
31
47
|
|
32
48
|
instapusher --debug
|
33
49
|
|
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
|
-
|
40
50
|
Pass host info like this
|
41
51
|
|
42
52
|
INSTAPUSHER_HOST=instapusher.com instapusher
|
@@ -65,23 +75,7 @@ that team members can actually test the feature.
|
|
65
75
|
|
66
76
|
## Here is how it works
|
67
77
|
|
68
|
-
|
69
|
-
`76-facebook-authentication`. When I execute `instapusher` then the
|
70
|
-
application name under which it will be deployed to heroku will be
|
71
|
-
`nimbleshop-76-facebook-ip`.
|
72
|
-
|
73
|
-
`nimbleshop` is the name of the project.
|
74
|
-
`76-facebook` is the first 10 letters of the branch name.
|
75
|
-
`ip` is characters to mark the instance as temporal.
|
76
|
-
|
77
|
-
So in this case the url of the application will be
|
78
|
-
`http://nnimbleshop-76-facebook-ip.herokuapp.com` .
|
79
|
-
|
80
|
-
There are three special branches `master`, `staging` and `production`.
|
81
|
-
For these branches the url generated will be just the application name and the
|
82
|
-
branch name. For example if I execute `instapusher` from `staging`
|
83
|
-
branch then the heroku url will be
|
84
|
-
`http://nimbleshop-staging.herokuapp.com`.
|
78
|
+
A video is coming up.
|
85
79
|
|
86
80
|
## License
|
87
81
|
|
File without changes
|
data/lib/instapusher/commands.rb
CHANGED
@@ -19,16 +19,16 @@ module Instapusher
|
|
19
19
|
|
20
20
|
def deploy
|
21
21
|
verify_api_key
|
22
|
-
SpecialInstructionForProduction.new.run if production?
|
22
|
+
#SpecialInstructionForProduction.new.run if production?
|
23
23
|
|
24
|
-
|
25
|
-
|
24
|
+
job_submission = JobSubmission.new(debug, options)
|
25
|
+
job_submission.submit_the_job
|
26
26
|
|
27
|
-
if
|
28
|
-
|
29
|
-
TagTheRelease.new(branch_name, debug).tagit if production?
|
27
|
+
if job_submission.success?
|
28
|
+
job_submission.feedback_to_user
|
29
|
+
TagTheRelease.new(branch_name, debug).tagit if (production? || staging?)
|
30
30
|
else
|
31
|
-
puts
|
31
|
+
puts job_submission.error_message
|
32
32
|
end
|
33
33
|
end
|
34
34
|
|
@@ -39,8 +39,8 @@ module Instapusher
|
|
39
39
|
{ project: project_name,
|
40
40
|
branch: branch_name,
|
41
41
|
owner: Git.new.repo_owner,
|
42
|
-
quick: @quick,
|
43
42
|
local: @local,
|
43
|
+
version: VERSION,
|
44
44
|
api_key: api_key }
|
45
45
|
end
|
46
46
|
end
|
@@ -61,5 +61,9 @@ module Instapusher
|
|
61
61
|
branch_name.intern == :production
|
62
62
|
end
|
63
63
|
|
64
|
+
def staging?
|
65
|
+
branch_name.intern == :staging
|
66
|
+
end
|
67
|
+
|
64
68
|
end
|
65
69
|
end
|
@@ -8,7 +8,7 @@ module Instapusher
|
|
8
8
|
attr_reader :_settings
|
9
9
|
|
10
10
|
def load(debug = false, filename=nil)
|
11
|
-
filename ||= File.join(ENV['HOME'],
|
11
|
+
filename ||= File.join(ENV['HOME'], instapusher_file_name)
|
12
12
|
|
13
13
|
unless File.exist? filename
|
14
14
|
File.new(filename, File::CREAT|File::TRUNC|File::RDWR, 0644).close
|
@@ -33,7 +33,7 @@ module Instapusher
|
|
33
33
|
def ask_for_and_write_api_key
|
34
34
|
api_key = ask_for_api_key
|
35
35
|
instapusher_config = {"api_key" => api_key}
|
36
|
-
File.open(File.join(Dir.home,
|
36
|
+
File.open(File.join(Dir.home, instapusher_file_name), "w") do |file|
|
37
37
|
file.write instapusher_config.to_yaml
|
38
38
|
end
|
39
39
|
|
@@ -49,5 +49,10 @@ module Instapusher
|
|
49
49
|
self.load
|
50
50
|
@_settings[name.to_s]
|
51
51
|
end
|
52
|
+
|
53
|
+
def instapusher_file_name
|
54
|
+
'.instapusher'
|
55
|
+
end
|
56
|
+
|
52
57
|
end
|
53
58
|
end
|
@@ -21,7 +21,7 @@ module Instapusher
|
|
21
21
|
end
|
22
22
|
|
23
23
|
def feedback_to_user
|
24
|
-
puts 'The
|
24
|
+
puts 'The application will be deployed to: ' + response_body['heroku_app_url']
|
25
25
|
puts 'Monitor the job status at: ' + job_status_url
|
26
26
|
cmd = "open #{job_status_url}"
|
27
27
|
`#{cmd}`
|
@@ -37,7 +37,7 @@ module Instapusher
|
|
37
37
|
response = Net::HTTP.post_form URI.parse(url_to_submit_job), options
|
38
38
|
@response_body = ::JSON.parse(response.body)
|
39
39
|
puts "response_body: #{response_body.inspect}" if debug
|
40
|
-
@job_status_url = response_body['
|
40
|
+
@job_status_url = response_body['status_url']
|
41
41
|
end
|
42
42
|
|
43
43
|
def url_to_submit_job
|
@@ -47,7 +47,7 @@ module Instapusher
|
|
47
47
|
else
|
48
48
|
ENV['INSTAPUSHER_HOST'] || DEFAULT_HOSTNAME
|
49
49
|
end
|
50
|
-
"http://#{hostname}/
|
50
|
+
"http://#{hostname}/api/v1/jobs.json"
|
51
51
|
end
|
52
52
|
end
|
53
53
|
end
|
data/lib/instapusher/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: instapusher
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0
|
4
|
+
version: 0.1.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Neeraj Singh
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-
|
11
|
+
date: 2014-05-18 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: hashr
|
@@ -66,7 +66,7 @@ files:
|
|
66
66
|
- README.md
|
67
67
|
- Rakefile
|
68
68
|
- bin/instapusher
|
69
|
-
-
|
69
|
+
- instapusher2.gemspec
|
70
70
|
- lib/instapusher.rb
|
71
71
|
- lib/instapusher/commands.rb
|
72
72
|
- lib/instapusher/configuration.rb
|