cf 3.0.0rc1 → 3.0.0rc2

Sign up to get free protection for your applications and to get access to all the features.
@@ -22,6 +22,7 @@ module CF::App
22
22
  app = client.app
23
23
 
24
24
  inputs.each { |key, value| app.send(:"#{key}=", value) }
25
+ finalize
25
26
 
26
27
  app = filter(:create_app, app)
27
28
 
@@ -42,7 +43,9 @@ module CF::App
42
43
  line unless quiet?
43
44
 
44
45
  host = input[:host, app.name]
46
+ finalize
45
47
  domain = input[:domain, app]
48
+ finalize
46
49
 
47
50
  mapped_url = false
48
51
  until domain == "none" || !domain || mapped_url
@@ -67,7 +70,7 @@ module CF::App
67
70
 
68
71
  def create_services(app)
69
72
  return unless input[:create_services]
70
-
73
+ finalize
71
74
  while true
72
75
  invoke :create_service, { :app => app }, :plan => :interact
73
76
  break unless ask("Create another service?", :default => false)
@@ -11,6 +11,7 @@ module CF::Service
11
11
  def bind_service
12
12
  app = input[:app]
13
13
  service = input[:service, app]
14
+ finalize
14
15
 
15
16
  with_progress(
16
17
  "Binding #{c(service.name, :name)} to #{c(app.name, :name)}") do |s|
@@ -44,8 +44,10 @@ module CF::Service
44
44
  end
45
45
  end
46
46
  end
47
+ finalize
47
48
 
48
49
  selected_offerings = offerings.any? ? Array(input[:offering, offerings.sort_by(&:label)]) : []
50
+ finalize
49
51
 
50
52
  if selected_offerings.empty?
51
53
  fail "Cannot find services matching the given criteria."
@@ -55,8 +57,9 @@ module CF::Service
55
57
 
56
58
  service = client.service_instance
57
59
  service.name = input[:name, offering]
58
-
60
+ finalize
59
61
  plan = input[:plan, offering.service_plans]
62
+ finalize
60
63
  service.service_plan = if plan.is_a?(String)
61
64
  offering.service_plans.find { |p| p.name.casecmp(plan) == 0 }
62
65
  else
@@ -68,10 +71,12 @@ module CF::Service
68
71
  service.create!
69
72
  end
70
73
 
71
- if app = input[:app]
74
+ app = input[:app]
75
+ finalize
76
+
77
+ if app
72
78
  invoke :bind_service, :service => service, :app => app
73
79
  end
74
-
75
80
  service
76
81
  end
77
82
 
@@ -1,3 +1,3 @@
1
1
  module CF
2
- VERSION = "3.0.0rc1".freeze
2
+ VERSION = "3.0.0rc2".freeze
3
3
  end
@@ -263,6 +263,7 @@ module CF
263
263
  it "creates the app" do
264
264
  app.should_receive(:create!)
265
265
  app.should_receive(:upload).with(path)
266
+
266
267
  push.should_receive(:filter).with(:create_app, app) { app }
267
268
  push.should_receive(:filter).with(:push_app, app) { app }
268
269
  push.should_receive(:invoke).with(:map, :app => app, :host => host, :domain => domain)
@@ -0,0 +1,128 @@
1
+ require "spec_helper"
2
+ require "webmock/rspec"
3
+
4
+ if ENV["CF_V2_RUN_INTEGRATION"]
5
+ describe "A user pushing a new sinatra app", :ruby19 => true do
6
+ include CF::Interactive
7
+
8
+ let(:run_id) { TRAVIS_BUILD_ID.to_s + Time.new.to_f.to_s.gsub(".", "_") }
9
+ let(:app) { "hello-sinatra-#{run_id}" }
10
+ let(:service_name) { "dummy-service-#{run_id}" }
11
+
12
+ before do
13
+ FileUtils.rm_rf File.expand_path(CF::CONFIG_DIR)
14
+ WebMock.allow_net_connect!
15
+ Interact::Progress::Dots.start!
16
+ login
17
+ end
18
+
19
+ after do
20
+ `#{cf_bin} unbind-service -f --no-script #{service_name} #{app}`
21
+ `#{cf_bin} delete-service -f --no-script #{service_name}`
22
+ `#{cf_bin} delete #{app} -f --routes --no-script`
23
+ logout
24
+ Interact::Progress::Dots.stop!
25
+ end
26
+
27
+ it "attempts to change already processed choices" do
28
+ BlueShell::Runner.run("#{cf_bin} app #{app}") do |runner|
29
+ expect(runner).to say "Unknown app '#{app}'."
30
+ end
31
+
32
+ Dir.chdir("#{SPEC_ROOT}/assets/hello-sinatra") do
33
+ BlueShell::Runner.run("#{cf_bin} push") do |runner|
34
+ expect(runner).to say "Name>"
35
+ runner.send_keys app
36
+
37
+ expect(runner).to say "Instances> 1"
38
+ runner.send_return
39
+
40
+ expect(runner).to_not say "Custom startup command> "
41
+
42
+ runner.send_up_arrow
43
+ expect(runner).to say "Instances> 1"
44
+ runner.send_return
45
+
46
+ expect(runner).to say "Memory Limit>"
47
+ runner.send_keys "128M"
48
+
49
+ expect(runner).to say "Creating #{app}... OK"
50
+
51
+ expect(runner).to say "Subdomain> #{app}"
52
+
53
+ runner.send_up_arrow
54
+ expect(runner).not_to say "Memory Limit>"
55
+ runner.send_return
56
+
57
+ expect(runner).to say "1:"
58
+ expect(runner).to say "Domain>"
59
+ runner.send_keys "1"
60
+
61
+ expect(runner).to say(/Creating route #{app}\..*\.\.\. OK/)
62
+ expect(runner).to say(/Binding #{app}\..* to #{app}\.\.\. OK/)
63
+
64
+ expect(runner).to say "Create services for application?> n"
65
+ runner.send_up_arrow
66
+ expect(runner).not_to say "Domain>"
67
+ runner.send_keys "y"
68
+
69
+ # create a service here
70
+ expect(runner).to say "What kind?>"
71
+ runner.send_keys "dummy n/a"
72
+
73
+ expect(runner).to say "Name?>"
74
+ runner.send_keys service_name
75
+
76
+ expect(runner).to say "Which plan?>"
77
+ runner.send_keys "small"
78
+
79
+ expect(runner).to say /Creating service #{service_name}.*OK/
80
+ expect(runner).to say /Binding .+ to .+ OK/
81
+
82
+ expect(runner).to say "Create another service?> n"
83
+ runner.send_up_arrow
84
+ expect(runner).not_to say "Which plan?>"
85
+ runner.send_up_arrow
86
+ expect(runner).not_to say "Which plan?>"
87
+ runner.send_return
88
+
89
+ if runner.expect "Bind other services to application?> n", 15
90
+ runner.send_return
91
+ end
92
+
93
+ expect(runner).to say "Save configuration?> n", 20
94
+ runner.send_return
95
+
96
+ expect(runner).to say "Uploading #{app}... OK", 180
97
+ expect(runner).to say "Starting #{app}... OK", 180
98
+ expect(runner).to say "Checking #{app}...", 180
99
+ expect(runner).to say "1/1 instances"
100
+ expect(runner).to say "OK", 30
101
+ end
102
+ end
103
+
104
+ BlueShell::Runner.run("#{cf_bin} services") do |runner|
105
+ expect(runner).to say /name\s+service\s+provider\s+version\s+plan\s+bound apps/
106
+ expect(runner).to say /dummy-service-.+?\s+ # name
107
+ dummy\s+ # service
108
+ dummy\s+ # provider
109
+ n\/a\s+ # version
110
+ small\s+ # plan
111
+ #{app} # bound apps
112
+ /x
113
+ end
114
+
115
+ BlueShell::Runner.run("#{cf_bin} unbind-service #{service_name} #{app}") do |runner|
116
+ expect(runner).to say "OK", 20
117
+ end
118
+
119
+ BlueShell::Runner.run("#{cf_bin} delete #{app}") do |runner|
120
+ expect(runner).to say "Really delete #{app}?>"
121
+ runner.send_keys "y"
122
+ expect(runner).to say "Deleting #{app}... OK"
123
+ end
124
+ end
125
+ end
126
+ else
127
+ $stderr.puts 'Skipping v2 integration specs; please provide necessary environment variables'
128
+ end
metadata CHANGED
@@ -1,7 +1,8 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: cf
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.0.0rc1
4
+ version: 3.0.0rc2
5
+ prerelease: 5
5
6
  platform: ruby
6
7
  authors:
7
8
  - Cloud Foundry Team
@@ -9,11 +10,12 @@ authors:
9
10
  autorequire:
10
11
  bindir: bin
11
12
  cert_chain: []
12
- date: 2013-06-17 00:00:00.000000000 Z
13
+ date: 2013-06-18 00:00:00.000000000 Z
13
14
  dependencies:
14
15
  - !ruby/object:Gem::Dependency
15
16
  name: addressable
16
17
  requirement: !ruby/object:Gem::Requirement
18
+ none: false
17
19
  requirements:
18
20
  - - ~>
19
21
  - !ruby/object:Gem::Version
@@ -21,6 +23,7 @@ dependencies:
21
23
  type: :runtime
22
24
  prerelease: false
23
25
  version_requirements: !ruby/object:Gem::Requirement
26
+ none: false
24
27
  requirements:
25
28
  - - ~>
26
29
  - !ruby/object:Gem::Version
@@ -28,6 +31,7 @@ dependencies:
28
31
  - !ruby/object:Gem::Dependency
29
32
  name: caldecott-client
30
33
  requirement: !ruby/object:Gem::Requirement
34
+ none: false
31
35
  requirements:
32
36
  - - ~>
33
37
  - !ruby/object:Gem::Version
@@ -35,6 +39,7 @@ dependencies:
35
39
  type: :runtime
36
40
  prerelease: false
37
41
  version_requirements: !ruby/object:Gem::Requirement
42
+ none: false
38
43
  requirements:
39
44
  - - ~>
40
45
  - !ruby/object:Gem::Version
@@ -42,6 +47,7 @@ dependencies:
42
47
  - !ruby/object:Gem::Dependency
43
48
  name: cfoundry
44
49
  requirement: !ruby/object:Gem::Requirement
50
+ none: false
45
51
  requirements:
46
52
  - - ! '>='
47
53
  - !ruby/object:Gem::Version
@@ -52,6 +58,7 @@ dependencies:
52
58
  type: :runtime
53
59
  prerelease: false
54
60
  version_requirements: !ruby/object:Gem::Requirement
61
+ none: false
55
62
  requirements:
56
63
  - - ! '>='
57
64
  - !ruby/object:Gem::Version
@@ -62,6 +69,7 @@ dependencies:
62
69
  - !ruby/object:Gem::Dependency
63
70
  name: interact
64
71
  requirement: !ruby/object:Gem::Requirement
72
+ none: false
65
73
  requirements:
66
74
  - - ~>
67
75
  - !ruby/object:Gem::Version
@@ -69,6 +77,7 @@ dependencies:
69
77
  type: :runtime
70
78
  prerelease: false
71
79
  version_requirements: !ruby/object:Gem::Requirement
80
+ none: false
72
81
  requirements:
73
82
  - - ~>
74
83
  - !ruby/object:Gem::Version
@@ -76,6 +85,7 @@ dependencies:
76
85
  - !ruby/object:Gem::Dependency
77
86
  name: json_pure
78
87
  requirement: !ruby/object:Gem::Requirement
88
+ none: false
79
89
  requirements:
80
90
  - - ~>
81
91
  - !ruby/object:Gem::Version
@@ -83,6 +93,7 @@ dependencies:
83
93
  type: :runtime
84
94
  prerelease: false
85
95
  version_requirements: !ruby/object:Gem::Requirement
96
+ none: false
86
97
  requirements:
87
98
  - - ~>
88
99
  - !ruby/object:Gem::Version
@@ -90,6 +101,7 @@ dependencies:
90
101
  - !ruby/object:Gem::Dependency
91
102
  name: mothership
92
103
  requirement: !ruby/object:Gem::Requirement
104
+ none: false
93
105
  requirements:
94
106
  - - ! '>='
95
107
  - !ruby/object:Gem::Version
@@ -100,6 +112,7 @@ dependencies:
100
112
  type: :runtime
101
113
  prerelease: false
102
114
  version_requirements: !ruby/object:Gem::Requirement
115
+ none: false
103
116
  requirements:
104
117
  - - ! '>='
105
118
  - !ruby/object:Gem::Version
@@ -110,6 +123,7 @@ dependencies:
110
123
  - !ruby/object:Gem::Dependency
111
124
  name: multi_json
112
125
  requirement: !ruby/object:Gem::Requirement
126
+ none: false
113
127
  requirements:
114
128
  - - ~>
115
129
  - !ruby/object:Gem::Version
@@ -117,6 +131,7 @@ dependencies:
117
131
  type: :runtime
118
132
  prerelease: false
119
133
  version_requirements: !ruby/object:Gem::Requirement
134
+ none: false
120
135
  requirements:
121
136
  - - ~>
122
137
  - !ruby/object:Gem::Version
@@ -124,6 +139,7 @@ dependencies:
124
139
  - !ruby/object:Gem::Dependency
125
140
  name: rest-client
126
141
  requirement: !ruby/object:Gem::Requirement
142
+ none: false
127
143
  requirements:
128
144
  - - ~>
129
145
  - !ruby/object:Gem::Version
@@ -131,6 +147,7 @@ dependencies:
131
147
  type: :runtime
132
148
  prerelease: false
133
149
  version_requirements: !ruby/object:Gem::Requirement
150
+ none: false
134
151
  requirements:
135
152
  - - ~>
136
153
  - !ruby/object:Gem::Version
@@ -138,6 +155,7 @@ dependencies:
138
155
  - !ruby/object:Gem::Dependency
139
156
  name: uuidtools
140
157
  requirement: !ruby/object:Gem::Requirement
158
+ none: false
141
159
  requirements:
142
160
  - - ~>
143
161
  - !ruby/object:Gem::Version
@@ -145,6 +163,7 @@ dependencies:
145
163
  type: :runtime
146
164
  prerelease: false
147
165
  version_requirements: !ruby/object:Gem::Requirement
166
+ none: false
148
167
  requirements:
149
168
  - - ~>
150
169
  - !ruby/object:Gem::Version
@@ -152,6 +171,7 @@ dependencies:
152
171
  - !ruby/object:Gem::Dependency
153
172
  name: anchorman
154
173
  requirement: !ruby/object:Gem::Requirement
174
+ none: false
155
175
  requirements:
156
176
  - - ! '>='
157
177
  - !ruby/object:Gem::Version
@@ -159,6 +179,7 @@ dependencies:
159
179
  type: :development
160
180
  prerelease: false
161
181
  version_requirements: !ruby/object:Gem::Requirement
182
+ none: false
162
183
  requirements:
163
184
  - - ! '>='
164
185
  - !ruby/object:Gem::Version
@@ -166,20 +187,23 @@ dependencies:
166
187
  - !ruby/object:Gem::Dependency
167
188
  name: blue-shell
168
189
  requirement: !ruby/object:Gem::Requirement
190
+ none: false
169
191
  requirements:
170
- - - '='
192
+ - - ! '>='
171
193
  - !ruby/object:Gem::Version
172
- version: 0.0.3
194
+ version: 0.2.1
173
195
  type: :development
174
196
  prerelease: false
175
197
  version_requirements: !ruby/object:Gem::Requirement
198
+ none: false
176
199
  requirements:
177
- - - '='
200
+ - - ! '>='
178
201
  - !ruby/object:Gem::Version
179
- version: 0.0.3
202
+ version: 0.2.1
180
203
  - !ruby/object:Gem::Dependency
181
204
  name: factory_girl
182
205
  requirement: !ruby/object:Gem::Requirement
206
+ none: false
183
207
  requirements:
184
208
  - - ! '>='
185
209
  - !ruby/object:Gem::Version
@@ -187,6 +211,7 @@ dependencies:
187
211
  type: :development
188
212
  prerelease: false
189
213
  version_requirements: !ruby/object:Gem::Requirement
214
+ none: false
190
215
  requirements:
191
216
  - - ! '>='
192
217
  - !ruby/object:Gem::Version
@@ -194,6 +219,7 @@ dependencies:
194
219
  - !ruby/object:Gem::Dependency
195
220
  name: fakefs
196
221
  requirement: !ruby/object:Gem::Requirement
222
+ none: false
197
223
  requirements:
198
224
  - - ~>
199
225
  - !ruby/object:Gem::Version
@@ -201,6 +227,7 @@ dependencies:
201
227
  type: :development
202
228
  prerelease: false
203
229
  version_requirements: !ruby/object:Gem::Requirement
230
+ none: false
204
231
  requirements:
205
232
  - - ~>
206
233
  - !ruby/object:Gem::Version
@@ -208,6 +235,7 @@ dependencies:
208
235
  - !ruby/object:Gem::Dependency
209
236
  name: ffaker
210
237
  requirement: !ruby/object:Gem::Requirement
238
+ none: false
211
239
  requirements:
212
240
  - - '='
213
241
  - !ruby/object:Gem::Version
@@ -215,6 +243,7 @@ dependencies:
215
243
  type: :development
216
244
  prerelease: false
217
245
  version_requirements: !ruby/object:Gem::Requirement
246
+ none: false
218
247
  requirements:
219
248
  - - '='
220
249
  - !ruby/object:Gem::Version
@@ -222,6 +251,7 @@ dependencies:
222
251
  - !ruby/object:Gem::Dependency
223
252
  name: rake
224
253
  requirement: !ruby/object:Gem::Requirement
254
+ none: false
225
255
  requirements:
226
256
  - - ~>
227
257
  - !ruby/object:Gem::Version
@@ -229,6 +259,7 @@ dependencies:
229
259
  type: :development
230
260
  prerelease: false
231
261
  version_requirements: !ruby/object:Gem::Requirement
262
+ none: false
232
263
  requirements:
233
264
  - - ~>
234
265
  - !ruby/object:Gem::Version
@@ -236,6 +267,7 @@ dependencies:
236
267
  - !ruby/object:Gem::Dependency
237
268
  name: rspec
238
269
  requirement: !ruby/object:Gem::Requirement
270
+ none: false
239
271
  requirements:
240
272
  - - ~>
241
273
  - !ruby/object:Gem::Version
@@ -243,6 +275,7 @@ dependencies:
243
275
  type: :development
244
276
  prerelease: false
245
277
  version_requirements: !ruby/object:Gem::Requirement
278
+ none: false
246
279
  requirements:
247
280
  - - ~>
248
281
  - !ruby/object:Gem::Version
@@ -250,6 +283,7 @@ dependencies:
250
283
  - !ruby/object:Gem::Dependency
251
284
  name: rspec-instafail
252
285
  requirement: !ruby/object:Gem::Requirement
286
+ none: false
253
287
  requirements:
254
288
  - - ~>
255
289
  - !ruby/object:Gem::Version
@@ -257,6 +291,7 @@ dependencies:
257
291
  type: :development
258
292
  prerelease: false
259
293
  version_requirements: !ruby/object:Gem::Requirement
294
+ none: false
260
295
  requirements:
261
296
  - - ~>
262
297
  - !ruby/object:Gem::Version
@@ -264,6 +299,7 @@ dependencies:
264
299
  - !ruby/object:Gem::Dependency
265
300
  name: webmock
266
301
  requirement: !ruby/object:Gem::Requirement
302
+ none: false
267
303
  requirements:
268
304
  - - ~>
269
305
  - !ruby/object:Gem::Version
@@ -271,6 +307,7 @@ dependencies:
271
307
  type: :development
272
308
  prerelease: false
273
309
  version_requirements: !ruby/object:Gem::Requirement
310
+ none: false
274
311
  requirements:
275
312
  - - ~>
276
313
  - !ruby/object:Gem::Version
@@ -498,6 +535,7 @@ files:
498
535
  - spec/features/services_spec.rb
499
536
  - spec/features/space_spec.rb
500
537
  - spec/features/switching_targets_spec.rb
538
+ - spec/integration/push_flow_spec.rb
501
539
  - spec/manifests/errors_spec.rb
502
540
  - spec/manifests/loader/builder_spec.rb
503
541
  - spec/manifests/loader/normalizer_spec.rb
@@ -517,26 +555,27 @@ files:
517
555
  - bin/cf
518
556
  homepage: http://github.com/cloudfoundry/cf
519
557
  licenses: []
520
- metadata: {}
521
558
  post_install_message:
522
559
  rdoc_options: []
523
560
  require_paths:
524
561
  - lib
525
562
  required_ruby_version: !ruby/object:Gem::Requirement
563
+ none: false
526
564
  requirements:
527
565
  - - ! '>='
528
566
  - !ruby/object:Gem::Version
529
567
  version: '0'
530
568
  required_rubygems_version: !ruby/object:Gem::Requirement
569
+ none: false
531
570
  requirements:
532
571
  - - ! '>'
533
572
  - !ruby/object:Gem::Version
534
573
  version: 1.3.1
535
574
  requirements: []
536
575
  rubyforge_project: cf
537
- rubygems_version: 2.0.3
576
+ rubygems_version: 1.8.24
538
577
  signing_key:
539
- specification_version: 4
578
+ specification_version: 3
540
579
  summary: Friendly command-line interface for Cloud Foundry.
541
580
  test_files:
542
581
  - spec/assets/hello-sinatra/config.ru
@@ -655,6 +694,7 @@ test_files:
655
694
  - spec/features/services_spec.rb
656
695
  - spec/features/space_spec.rb
657
696
  - spec/features/switching_targets_spec.rb
697
+ - spec/integration/push_flow_spec.rb
658
698
  - spec/manifests/errors_spec.rb
659
699
  - spec/manifests/loader/builder_spec.rb
660
700
  - spec/manifests/loader/normalizer_spec.rb
checksums.yaml DELETED
@@ -1,7 +0,0 @@
1
- ---
2
- SHA1:
3
- metadata.gz: 4f67d8c3ab44498adea58fb50d2334f60e6af1a3
4
- data.tar.gz: 0b1471beb2d384df8dc6a84d6f7958106c902b91
5
- SHA512:
6
- metadata.gz: aaec1048764a06b5e7b277af33b00a5ec13a565a72e7cfa29aab5aede67e12a6b0853f8c91fee6934ea338ffb3acc9422d397f9e24f4ca9b376e5ce5750ab171
7
- data.tar.gz: 4cb90ad017c6b9e89b5dce07935c44457d09aa1ef32a8e2f8730cc14c5fdfb54f80841b136b58ab4d4ba6d04b87e779709285d527437b51f93e6ebbdd77e3b56