heroku-bartender 0.1.3 → 0.1.4

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.
data/README.markdown CHANGED
@@ -3,17 +3,22 @@ Is a simple way to manage releases in heroku
3
3
 
4
4
  # How to bartender
5
5
  ## Install
6
- gem install heroku-bartender
6
+ gem install heroku-bartender
7
7
  ## Run
8
- heroku-bartender
8
+ heroku-bartender
9
+ ## Options
10
+ Server options:
11
+ -h, --host=HOST The hostname or ip of the host to bind to (default 0.0.0.0)
12
+ -p, --port=PORT The port to listen on (default 4567)
13
+ -t, --target=TARGET The target is the git remote in which you want to deploy (default heroku)
14
+
9
15
  For now you must run `heroku-bartender` inside your repo dir
10
16
  # Feature
11
17
  You can rollback your heroku app to a specific commit hash
12
18
 
13
19
  # TODO
14
- 0. Keep update the repo
15
- 1. Handle branches/tags
16
- 2. Parametrization
20
+ 1. Keep update the repo
21
+ 2. Handle branches/tags
17
22
  3. DB Rollback
18
23
  4. Styling view
19
24
  5. Async build
data/bin/heroku-bartender CHANGED
@@ -5,7 +5,7 @@ require 'heroku/bartender'
5
5
  require 'choice'
6
6
 
7
7
  Choice.options do
8
- banner "Usage: #{File.basename(__FILE__)} [-hpv] path_to_git_repo"
8
+ banner "Usage: #{File.basename(__FILE__)} [-hptv]"
9
9
  header ''
10
10
  header 'Server options:'
11
11
 
@@ -28,7 +28,14 @@ Choice.options do
28
28
 
29
29
  separator ''
30
30
  separator 'Common options: '
31
-
31
+
32
+ option :target do
33
+ d = "heroku"
34
+ short '-t'
35
+ long '--target=TARGET'
36
+ desc "The target is the git remote in which you want to deploy (default #{d})"
37
+ default d
38
+ end
32
39
  option :help do
33
40
  long '--help'
34
41
  desc 'Show this message'
@@ -48,4 +55,4 @@ end
48
55
  options = Choice.choices
49
56
 
50
57
 
51
- Heroku::Bartender::Server.run! :host => options[:host], :port => options[:port]
58
+ Heroku::Bartender::Server.start(options[:host], options[:port], options[:target])
@@ -3,8 +3,8 @@ module Heroku
3
3
  class Command
4
4
  # move to an specific commit
5
5
  # Pending ada more testing stuff
6
- def self.move_to release
7
- `git push -f heroku #{release}:master`
6
+ def move_to release, heroku_remote
7
+ `git push -f #{heroku_remote} #{release}:master`
8
8
  end
9
9
  end
10
10
  end
@@ -3,18 +3,23 @@ require 'erb'
3
3
  module Heroku
4
4
  module Bartender
5
5
  class Server < Sinatra::Base
6
+ @@heroku_remote
6
7
  dir = File.dirname(File.expand_path(__FILE__))
7
8
  set :views, "#{dir}/views"
8
-
9
9
  get "/" do
10
10
  erb(:template, {}, :commits => Log.generate_commits)
11
11
  end
12
12
  post "/" do
13
13
  if params[:sha]
14
- Command.move_to params[:sha]
14
+ Command.move_to params[:sha], @@heroku_remote
15
15
  end
16
16
  erb(:template, {}, :commits => Log.generate_commits)
17
17
  end
18
+ def self.start(host, port, heroku_remote)
19
+ @@heroku_remote = heroku_remote
20
+ puts @@heroku_remote
21
+ Heroku::Bartender::Server.run!(:host => host, :port => port)
22
+ end
18
23
  end
19
24
  end
20
25
  end
@@ -1,5 +1,5 @@
1
1
  module Heroku
2
2
  module Bartender
3
- VERSION = '0.1.3'
3
+ VERSION = '0.1.4'
4
4
  end
5
5
  end
metadata CHANGED
@@ -2,7 +2,7 @@
2
2
  name: heroku-bartender
3
3
  version: !ruby/object:Gem::Version
4
4
  prerelease:
5
- version: 0.1.3
5
+ version: 0.1.4
6
6
  platform: ruby
7
7
  authors:
8
8
  - Sebastian Arcila-Valenzuela