kibo 0.4.1 → 0.4.2
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/kibo/commands/setup.rb +26 -9
- data/lib/kibo/config.rb +2 -1
- data/lib/kibo/version.rb +1 -1
- data/man/kibo.1 +1 -1
- data/man/kibo.1.html +1 -1
- metadata +2 -2
data/lib/kibo/commands/setup.rb
CHANGED
@@ -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
|
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
|
22
|
-
# a new instance has been created.
|
23
|
-
|
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
|
-
|
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
|
53
|
-
Kibo.config.
|
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.
|
60
|
-
|
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
data/lib/kibo/version.rb
CHANGED
data/man/kibo.1
CHANGED
data/man/kibo.1.html
CHANGED
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.
|
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:
|
183
|
+
hash: 3119348914101748523
|
184
184
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
185
185
|
none: false
|
186
186
|
requirements:
|