af 0.5.0.beta.10 → 0.5.0.beta.11
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +8 -8
- data/lib/af/version.rb +1 -1
- data/lib/vmc/cli.rb +13 -7
- data/lib/vmc/cli/app/apps.rb +2 -2
- data/lib/vmc/cli/app/push.rb +1 -1
- data/lib/vmc/cli/app/push/create.rb +3 -3
- data/lib/vmc/cli/app/push/interactions.rb +5 -1
- data/lib/vmc/cli/service/create.rb +2 -2
- data/lib/vmc/cli/service/services.rb +2 -2
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,15 +1,15 @@
|
|
1
1
|
---
|
2
2
|
!binary "U0hBMQ==":
|
3
3
|
metadata.gz: !binary |-
|
4
|
-
|
4
|
+
M2FkZjBkNWU3NWI2YTcyOGUxZTgzYjlmOTgyZDBjOGQ1NmI4MTVlMw==
|
5
5
|
data.tar.gz: !binary |-
|
6
|
-
|
6
|
+
NDIwNzJjZGUxY2RiZTMyOTU5OGQ5Mjc3MTM3Nzg3N2FmYzUxNmY5Yg==
|
7
7
|
!binary "U0hBNTEy":
|
8
8
|
metadata.gz: !binary |-
|
9
|
-
|
10
|
-
|
11
|
-
|
9
|
+
NGYxNmY3ZDM2NTBmOTQxZTVhYzhmYTE5YzY3Y2Y2MGFiNzZjMjAzYTk4NzUw
|
10
|
+
ZGViMTZjOThlNzNlNzRjZDM1MTE2YTlhYTM0NmY4NGIzOWRkMjc2ZmM3MTZm
|
11
|
+
Y2M3NmRiYTY1MDRkZjk2MmQ3MGMzZWQwYmVhMzhjZDVkY2FmMDc=
|
12
12
|
data.tar.gz: !binary |-
|
13
|
-
|
14
|
-
|
15
|
-
|
13
|
+
MDc2YzlkYmMyMTEyMjg3N2MyNGU5MTJkZmY4YmNiNjRkODQwMzRiMmY2ZmJm
|
14
|
+
YjJmNmFlY2E2NjhhYmZiNmFlNTRkMDNmZjE2YzRlYjdlMTdhMzEwNTAwZmMx
|
15
|
+
YTcxMTZkZGZiMWI3YjU5ZTczY2U1Nzc2YTdjNTEwYmE0NDNmYzg=
|
data/lib/af/version.rb
CHANGED
data/lib/vmc/cli.rb
CHANGED
@@ -56,6 +56,8 @@ module VMC
|
|
56
56
|
option :trace, :desc => "Show API traffic", :alias => "-t",
|
57
57
|
:default => false
|
58
58
|
|
59
|
+
option :infras, :desc => "Query infras",
|
60
|
+
:type => :boolean, :default => proc { true }
|
59
61
|
|
60
62
|
def default_action
|
61
63
|
if input[:version]
|
@@ -234,6 +236,10 @@ module VMC
|
|
234
236
|
input[:color]
|
235
237
|
end
|
236
238
|
|
239
|
+
def infras_enabled?
|
240
|
+
input[:infras]
|
241
|
+
end
|
242
|
+
|
237
243
|
def verbose?
|
238
244
|
input[:verbose]
|
239
245
|
end
|
@@ -405,14 +411,14 @@ module VMC
|
|
405
411
|
token = info[:token] && CFoundry::AuthToken.from_hash(info)
|
406
412
|
|
407
413
|
@@client =
|
408
|
-
|
409
|
-
|
410
|
-
|
411
|
-
|
412
|
-
|
413
|
-
|
414
|
+
# case info[:version]
|
415
|
+
# when 2
|
416
|
+
# CFoundry::V2::Client.new(target, token)
|
417
|
+
# when 1
|
418
|
+
# CFoundry::V1::Client.new(target, token)
|
419
|
+
# else
|
414
420
|
CFoundry::Client.new(target, token)
|
415
|
-
end
|
421
|
+
# end
|
416
422
|
|
417
423
|
@@client.proxy = input[:proxy]
|
418
424
|
@@client.trace = input[:trace]
|
data/lib/vmc/cli/app/apps.rb
CHANGED
@@ -59,10 +59,10 @@ module VMC::App
|
|
59
59
|
|
60
60
|
def display_apps_table(apps)
|
61
61
|
table(
|
62
|
-
["name", "infra", "status", "usage", v2? && "plan", "runtime", "url"],
|
62
|
+
["name", infras_enabled? && "infra", "status", "usage", v2? && "plan", "runtime", "url"],
|
63
63
|
apps.collect { |a|
|
64
64
|
[ c(a.name, :name),
|
65
|
-
c(a.infra.name, :infra),
|
65
|
+
infras_enabled? && c(a.infra.name, :infra),
|
66
66
|
app_status(a),
|
67
67
|
"#{a.total_instances} x #{human_mb(a.memory)}",
|
68
68
|
v2? && (a.production ? "prod" : "dev"),
|
data/lib/vmc/cli/app/push.rb
CHANGED
@@ -32,7 +32,7 @@ module VMC::App
|
|
32
32
|
input :plan, :desc => "Application plan", :default => "D100"
|
33
33
|
input :start, :desc => "Start app after pushing?", :default => true
|
34
34
|
input :restart, :desc => "Restart app after updating?", :default => true
|
35
|
-
input :buildpack, :desc => "Custom buildpack URL", :default => nil
|
35
|
+
# input :buildpack, :desc => "Custom buildpack URL", :default => nil
|
36
36
|
input :create_services, :desc => "Interactively create services?",
|
37
37
|
:type => :boolean, :default => proc { force? ? false : interact }
|
38
38
|
input :bind_services, :desc => "Interactively bind services?",
|
@@ -8,7 +8,7 @@ module VMC::App
|
|
8
8
|
def get_inputs
|
9
9
|
inputs = {}
|
10
10
|
inputs[:name] = name = input[:name]
|
11
|
-
inputs[:infra] = infra = determine_infra
|
11
|
+
inputs[:infra] = infra = determine_infra if infras_enabled?
|
12
12
|
inputs[:url] = input[:url, name, infra]
|
13
13
|
inputs[:uris] = [inputs[:url]]
|
14
14
|
inputs[:total_instances] = input[:instances]
|
@@ -26,12 +26,12 @@ module VMC::App
|
|
26
26
|
end
|
27
27
|
|
28
28
|
def ask_url(name, infra)
|
29
|
-
|
29
|
+
urlbase = !infra.nil? ? "#{infra.base}" : "no-infra.af.cm"
|
30
|
+
ask("Enter URL?", :default => "#{name}.#{urlbase}")
|
30
31
|
end
|
31
32
|
|
32
33
|
def determine_infra
|
33
34
|
return input[:infra] if input.has?(:infra)
|
34
|
-
|
35
35
|
input[:infra, detector.all_infras, nil, nil]
|
36
36
|
end
|
37
37
|
|
@@ -40,7 +40,11 @@ module VMC::App
|
|
40
40
|
end
|
41
41
|
|
42
42
|
def ask_infra(choices, default, other)
|
43
|
-
|
43
|
+
ask("Infrastructure?", :choices => client.infras,
|
44
|
+
:display => proc { |s|
|
45
|
+
str = "#{c(s.name, :name)} - #{s.description}"
|
46
|
+
},
|
47
|
+
:complete => proc { |s| "#{s.name} #{s.description}" })
|
44
48
|
end
|
45
49
|
|
46
50
|
def ask_runtime(choices, default, other)
|
@@ -25,7 +25,7 @@ module VMC::Service
|
|
25
25
|
def create_service
|
26
26
|
offerings = client.services
|
27
27
|
|
28
|
-
if input[:infra]
|
28
|
+
if infras_enabled? && input[:infra]
|
29
29
|
offerings.reject! { |s| s.infra.to_s != input[:infra].name }
|
30
30
|
end
|
31
31
|
|
@@ -66,7 +66,7 @@ module VMC::Service
|
|
66
66
|
|
67
67
|
service = client.service_instance
|
68
68
|
|
69
|
-
service.infra_name = input[:infra].name
|
69
|
+
service.infra_name = input[:infra].name if infras_enabled?
|
70
70
|
service.name = input[:name, offering]
|
71
71
|
|
72
72
|
if v2?
|
@@ -45,7 +45,7 @@ module VMC::Service
|
|
45
45
|
end
|
46
46
|
else
|
47
47
|
table(
|
48
|
-
["name", "infra", "service", "version", v2? && "plan", v2? && "bound apps"],
|
48
|
+
["name", infras_enabled? && "infra", "service", "version", v2? && "plan", v2? && "bound apps"],
|
49
49
|
services.collect { |i|
|
50
50
|
if v2?
|
51
51
|
plan = i.service_plan
|
@@ -60,7 +60,7 @@ module VMC::Service
|
|
60
60
|
end
|
61
61
|
|
62
62
|
[ c(i.name, :name),
|
63
|
-
c(i.infra.name, :infra),
|
63
|
+
infras_enabled? && c(i.infra.name, :infra),
|
64
64
|
label,
|
65
65
|
version,
|
66
66
|
v2? && plan.name,
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: af
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.5.0.beta.
|
4
|
+
version: 0.5.0.beta.11
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Cloud Foundry Team
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2013-04-
|
12
|
+
date: 2013-04-18 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: json_pure
|