kibo 0.4.1 → 0.4.2

Sign up to get free protection for your applications and to get access to all the features.
@@ -5,7 +5,7 @@ require_relative "../heroku"
5
5
 
6
6
  module Kibo::Commands
7
7
  subcommand :setup, "Setup and configure application instances" do
8
- opt :force, "Reconfigure existing instances, too.", :short => "f"
8
+ opt :force, "Reconfigure existing instances.", :short => "f"
9
9
  end
10
10
 
11
11
  subcommand :reconfigure, "Reconfigure application instances"
@@ -18,10 +18,11 @@ module Kibo::Commands
18
18
  Kibo.config.instances.each do |instance|
19
19
  next unless create_instance(instance) || Kibo::CommandLine.force?
20
20
 
21
- # The following only when forced (--force) to do so or when
22
- # a new instance has been created.
23
- collaborate_instance instance
21
+ # The following only when forced (--force) to do so
22
+ # or when a new instance has been created.
23
+
24
24
  provide_instance instance
25
+ share_instance instance
25
26
  configure_instance instance
26
27
  end
27
28
  end
@@ -30,7 +31,8 @@ module Kibo::Commands
30
31
  # create all apps on heroku or make sure that they
31
32
  # exist as remotes in the local git configuration.
32
33
  Kibo.config.instances.each do |instance|
33
- # provide_instance instance
34
+ provide_instance instance
35
+ share_instance instance
34
36
  configure_instance instance
35
37
  end
36
38
  end
@@ -49,15 +51,30 @@ module Kibo::Commands
49
51
  true
50
52
  end
51
53
 
52
- def collaborate_instance(instance)
53
- Kibo.config.collaborators.each do |email|
54
+ def share_instance(instance)
55
+ Kibo.config.sharing.each do |email|
54
56
  heroku "sharing:add", email, "--app", instance
55
57
  end
56
58
  end
57
59
 
58
60
  def provide_instance(instance)
59
- instance.addons.each do |addon|
60
- heroku "addons:add", addon
61
+ partial_instance_name = instance.split("-").last # e.g. "web1"
62
+
63
+ return unless instance_addons = Kibo.config.addons[partial_instance_name]
64
+
65
+ existing_instance_addons =
66
+ heroku("addons", "--app", instance, :quiet).
67
+ split("\n").
68
+ map do |line|
69
+ next if line =~ /^=== /
70
+ line.split(/\s+/).first
71
+ end.compact
72
+
73
+ W "[#{instance}] addons", *existing_instance_addons
74
+
75
+ missing = instance_addons - existing_instance_addons
76
+ missing.each do |addon|
77
+ heroku "addons:add", addon, "--app", instance
61
78
  end
62
79
  end
63
80
 
data/lib/kibo/config.rb CHANGED
@@ -9,7 +9,8 @@ class Kibo::Config < Mash
9
9
  "deployment" => {},
10
10
  "collaborations" => {},
11
11
  "source" => {},
12
- "collaborators" => []
12
+ "sharing" => [],
13
+ "addons" => {}
13
14
  }
14
15
 
15
16
  attr :environment, :kibofile
data/lib/kibo/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Kibo
2
- VERSION = "0.4.1"
2
+ VERSION = "0.4.2"
3
3
  end
data/man/kibo.1 CHANGED
@@ -1,7 +1,7 @@
1
1
  .\" generated with Ronn/v0.7.3
2
2
  .\" http://github.com/rtomayko/ronn/tree/0.7.3
3
3
  .
4
- .TH "KIBO" "1" "October 2012" "Kibo 0.4.1" "Kibo Manual"
4
+ .TH "KIBO" "1" "October 2012" "Kibo 0.4.2" "Kibo Manual"
5
5
  .
6
6
  .SH "NAME"
7
7
  \fBkibo\fR \- manage heroku applications
data/man/kibo.1.html CHANGED
@@ -172,7 +172,7 @@ kibo -e production spindown
172
172
 
173
173
 
174
174
  <ol class='man-decor man-foot man foot'>
175
- <li class='tl'>Kibo 0.4.1</li>
175
+ <li class='tl'>Kibo 0.4.2</li>
176
176
  <li class='tc'>October 2012</li>
177
177
  <li class='tr'>kibo(1)</li>
178
178
  </ol>
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: kibo
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.1
4
+ version: 0.4.2
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -180,7 +180,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
180
180
  version: '0'
181
181
  segments:
182
182
  - 0
183
- hash: -2440088423911513347
183
+ hash: 3119348914101748523
184
184
  required_rubygems_version: !ruby/object:Gem::Requirement
185
185
  none: false
186
186
  requirements: