bosh_cli 1.0.rc1 → 1.0
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/cli/commands/deployment.rb +23 -3
- data/lib/cli/commands/release.rb +4 -3
- data/lib/cli/commands/task.rb +4 -4
- data/lib/cli/director.rb +18 -5
- data/lib/cli/packaging_helper.rb +14 -11
- data/lib/cli/release.rb +7 -1
- data/lib/cli/runner.rb +2 -2
- data/lib/cli/version.rb +1 -1
- data/lib/cli/versions_index.rb +6 -7
- data/spec/assets/config/bad-providers/config/final.yml +5 -0
- data/spec/assets/config/bad-providers/config/private.yml +4 -0
- data/spec/assets/config/local/config/final.yml +5 -0
- data/spec/assets/config/local/config/private.yml +1 -0
- data/spec/spec_helper.rb +8 -0
- data/spec/unit/director_spec.rb +26 -1
- data/spec/unit/job_builder_spec.rb +3 -2
- data/spec/unit/package_builder_spec.rb +11 -5
- data/spec/unit/release_builder_spec.rb +6 -2
- data/spec/unit/release_spec.rb +18 -0
- data/spec/unit/versions_index_spec.rb +28 -16
- metadata +17 -6
@@ -195,9 +195,29 @@ module Bosh::Cli::Command
|
|
195
195
|
err("No deployments") if deployments.empty?
|
196
196
|
|
197
197
|
deployments_table = table do |t|
|
198
|
-
t.headings = %w(Name)
|
199
|
-
deployments.each do |
|
200
|
-
|
198
|
+
t.headings = %w(Name Release(s) Stemcell(s))
|
199
|
+
deployments.each do |d|
|
200
|
+
deployment = director.get_deployment(d["name"])
|
201
|
+
|
202
|
+
row = if (deployment["manifest"])
|
203
|
+
manifest = YAML.load(deployment["manifest"])
|
204
|
+
|
205
|
+
stemcells = manifest["resource_pools"].map { |rp|
|
206
|
+
rp["stemcell"].values_at("name", "version").join("/")
|
207
|
+
}.sort.uniq
|
208
|
+
|
209
|
+
releases = manifest["releases"] || [manifest["release"]]
|
210
|
+
releases = releases.map { |rl|
|
211
|
+
rl.values_at("name", "version").join("/")
|
212
|
+
}.sort
|
213
|
+
|
214
|
+
[manifest["name"], releases.join("\n"), stemcells.join("\n")]
|
215
|
+
else
|
216
|
+
[d["name"], "n/a", "n/a"]
|
217
|
+
end
|
218
|
+
|
219
|
+
t.add_row(row)
|
220
|
+
t.add_separator unless d == deployments.last
|
201
221
|
end
|
202
222
|
end
|
203
223
|
|
data/lib/cli/commands/release.rb
CHANGED
@@ -152,9 +152,9 @@ module Bosh::Cli::Command
|
|
152
152
|
releases_table = table do |t|
|
153
153
|
t.headings = "Name", "Versions"
|
154
154
|
releases.each do |r|
|
155
|
-
versions = r["versions"].sort
|
155
|
+
versions = r["versions"].sort { |v1, v2|
|
156
156
|
version_cmp(v1, v2)
|
157
|
-
|
157
|
+
}.map { |v| ((r["in_use"] || []).include?(v)) ? "#{v}*" : v }
|
158
158
|
|
159
159
|
t << [r["name"], versions.join(", ")]
|
160
160
|
end
|
@@ -162,6 +162,7 @@ module Bosh::Cli::Command
|
|
162
162
|
|
163
163
|
nl
|
164
164
|
say(releases_table)
|
165
|
+
say("(*) Currently deployed") if releases_table.to_s =~ /\*/
|
165
166
|
nl
|
166
167
|
say("Releases total: %d" % releases.size)
|
167
168
|
end
|
@@ -521,4 +522,4 @@ module Bosh::Cli::Command
|
|
521
522
|
exit(1) unless confirmed?
|
522
523
|
end
|
523
524
|
end
|
524
|
-
end
|
525
|
+
end
|
data/lib/cli/commands/task.rb
CHANGED
@@ -10,7 +10,7 @@ module Bosh::Cli::Command
|
|
10
10
|
desc "Show task status and start tracking its output"
|
11
11
|
option "--no-cache", "Don't cache output locally"
|
12
12
|
option "--event", "Track event log"
|
13
|
-
option "--
|
13
|
+
option "--cpi", "Track CPI log"
|
14
14
|
option "--debug", "Track debug log"
|
15
15
|
option "--result", "Track result log"
|
16
16
|
option "--raw", "Show raw log"
|
@@ -23,8 +23,8 @@ module Bosh::Cli::Command
|
|
23
23
|
|
24
24
|
log_type = "event"
|
25
25
|
n_types = 0
|
26
|
-
if options[:
|
27
|
-
log_type = "
|
26
|
+
if options[:cpi]
|
27
|
+
log_type = "cpi"
|
28
28
|
n_types += 1
|
29
29
|
end
|
30
30
|
|
@@ -137,4 +137,4 @@ module Bosh::Cli::Command
|
|
137
137
|
use_filter ? 1 : 2
|
138
138
|
end
|
139
139
|
end
|
140
|
-
end
|
140
|
+
end
|
data/lib/cli/director.rb
CHANGED
@@ -18,7 +18,10 @@ module Bosh
|
|
18
18
|
# @return [String]
|
19
19
|
attr_accessor :password
|
20
20
|
|
21
|
-
|
21
|
+
# Options can include:
|
22
|
+
# * :no_track => true - do not use +TaskTracker+ for long-running
|
23
|
+
# +request_and_track+ calls
|
24
|
+
def initialize(director_uri, user = nil, password = nil, options = {})
|
22
25
|
if director_uri.nil? || director_uri =~ /^\s*$/
|
23
26
|
raise DirectorMissing, "no director URI given"
|
24
27
|
end
|
@@ -26,6 +29,7 @@ module Bosh
|
|
26
29
|
@director_uri = director_uri
|
27
30
|
@user = user
|
28
31
|
@password = password
|
32
|
+
@track_tasks = !options.delete(:no_track)
|
29
33
|
end
|
30
34
|
|
31
35
|
def uuid
|
@@ -94,7 +98,6 @@ module Bosh
|
|
94
98
|
end
|
95
99
|
|
96
100
|
def list_recent_tasks(count = 30, verbose = 1)
|
97
|
-
count = [count.to_i, 100].min
|
98
101
|
get_json("/tasks?limit=#{count}&verbose=#{verbose}")
|
99
102
|
end
|
100
103
|
|
@@ -407,7 +410,13 @@ module Bosh
|
|
407
410
|
else
|
408
411
|
new_offset = nil
|
409
412
|
end
|
410
|
-
|
413
|
+
|
414
|
+
# backward compatible with renaming soap log to cpi log
|
415
|
+
if response_code == 204 && log_type == "cpi"
|
416
|
+
get_task_output(task_id, offset, "soap")
|
417
|
+
else
|
418
|
+
[body, new_offset]
|
419
|
+
end
|
411
420
|
end
|
412
421
|
|
413
422
|
def cancel_task(task_id)
|
@@ -443,8 +452,12 @@ module Bosh
|
|
443
452
|
if redirected
|
444
453
|
if location =~ /\/tasks\/(\d+)\/?$/ # Looks like we received task URI
|
445
454
|
task_id = $1
|
446
|
-
|
447
|
-
|
455
|
+
if @track_tasks
|
456
|
+
tracker = Bosh::Cli::TaskTracker.new(self, task_id, track_opts)
|
457
|
+
status = tracker.track
|
458
|
+
else
|
459
|
+
status = :running
|
460
|
+
end
|
448
461
|
else
|
449
462
|
status = :non_trackable
|
450
463
|
end
|
data/lib/cli/packaging_helper.rb
CHANGED
@@ -93,9 +93,13 @@ module Bosh::Cli
|
|
93
93
|
|
94
94
|
if need_fetch
|
95
95
|
say("Downloading `#{name} (#{version})'...".green)
|
96
|
-
|
97
|
-
|
98
|
-
|
96
|
+
tmp_file = File.open(File.join(Dir.mktmpdir, name), "w")
|
97
|
+
@blobstore.get(blobstore_id, tmp_file)
|
98
|
+
tmp_file.close
|
99
|
+
if Digest::SHA1.file(tmp_file.path).hexdigest == item["sha1"]
|
100
|
+
@tarball_path = @final_index.add_version(fingerprint,
|
101
|
+
item,
|
102
|
+
tmp_file.path)
|
99
103
|
else
|
100
104
|
err("`#{name}' (#{version}) is corrupted in blobstore " +
|
101
105
|
"(id=#{blobstore_id}), " +
|
@@ -167,14 +171,12 @@ module Bosh::Cli
|
|
167
171
|
end
|
168
172
|
end
|
169
173
|
|
170
|
-
payload = tmp_file.read
|
171
|
-
|
172
174
|
item = {
|
173
175
|
"version" => version
|
174
176
|
}
|
175
177
|
|
176
178
|
unless dry_run?
|
177
|
-
@dev_index.add_version(fingerprint, item,
|
179
|
+
@dev_index.add_version(fingerprint, item, tmp_file.path)
|
178
180
|
@tarball_path = @dev_index.filename(version)
|
179
181
|
end
|
180
182
|
|
@@ -189,16 +191,17 @@ module Bosh::Cli
|
|
189
191
|
|
190
192
|
say("Uploading final version #{version}...")
|
191
193
|
|
192
|
-
if
|
193
|
-
version = item["version"]
|
194
|
+
if item
|
194
195
|
say("This package has already been uploaded")
|
195
196
|
return
|
196
197
|
end
|
197
198
|
|
198
199
|
version = @final_index.latest_version.to_i + 1
|
199
|
-
payload = File.read(path)
|
200
200
|
|
201
|
-
blobstore_id =
|
201
|
+
blobstore_id = nil
|
202
|
+
File.open(path, "r") do |f|
|
203
|
+
blobstore_id = @blobstore.create(f)
|
204
|
+
end
|
202
205
|
|
203
206
|
item = {
|
204
207
|
"blobstore_id" => blobstore_id,
|
@@ -206,7 +209,7 @@ module Bosh::Cli
|
|
206
209
|
}
|
207
210
|
|
208
211
|
say("Uploaded, blobstore id #{blobstore_id}")
|
209
|
-
@final_index.add_version(fingerprint, item,
|
212
|
+
@final_index.add_version(fingerprint, item, path)
|
210
213
|
@tarball_path = @final_index.filename(version)
|
211
214
|
@version = version
|
212
215
|
@promoted = true
|
data/lib/cli/release.rb
CHANGED
@@ -135,7 +135,13 @@ module Bosh::Cli
|
|
135
135
|
# and merges it into the blobstore options.
|
136
136
|
def merge_private_data(provider, options)
|
137
137
|
bs = @private_config["blobstore"]
|
138
|
-
options
|
138
|
+
return options unless bs
|
139
|
+
|
140
|
+
if bs[provider].nil? && has_blobstore_secret?
|
141
|
+
err("blobstore private provider does not match final provider")
|
142
|
+
end
|
143
|
+
|
144
|
+
options.merge(bs[provider] ? bs[provider] : {})
|
139
145
|
end
|
140
146
|
|
141
147
|
# stores blobstore_secret as blobstore.atmos.secret
|
data/lib/cli/runner.rb
CHANGED
@@ -38,8 +38,8 @@ module Bosh::Cli
|
|
38
38
|
Config.interactive = !@options[:non_interactive]
|
39
39
|
Config.cache = Bosh::Cli::Cache.new(@options[:cache_dir])
|
40
40
|
|
41
|
-
build_parse_tree
|
42
41
|
load_plugins
|
42
|
+
build_parse_tree
|
43
43
|
add_shortcuts
|
44
44
|
|
45
45
|
if @args.empty?
|
@@ -252,4 +252,4 @@ module Bosh::Cli
|
|
252
252
|
search_parse_tree(@parse_tree)
|
253
253
|
end
|
254
254
|
end
|
255
|
-
end
|
255
|
+
end
|
data/lib/cli/version.rb
CHANGED
data/lib/cli/versions_index.rb
CHANGED
@@ -54,7 +54,7 @@ module Bosh::Cli
|
|
54
54
|
File.exists?(filename(version))
|
55
55
|
end
|
56
56
|
|
57
|
-
def add_version(fingerprint, item,
|
57
|
+
def add_version(fingerprint, item, tmp_file_path = nil)
|
58
58
|
version = item["version"]
|
59
59
|
|
60
60
|
if version.blank?
|
@@ -64,10 +64,8 @@ module Bosh::Cli
|
|
64
64
|
|
65
65
|
create_directories
|
66
66
|
|
67
|
-
if
|
68
|
-
|
69
|
-
f.write(payload)
|
70
|
-
end
|
67
|
+
if tmp_file_path
|
68
|
+
FileUtils.cp(tmp_file_path, filename(version), :preserve => true)
|
71
69
|
end
|
72
70
|
|
73
71
|
@data["builds"].each_pair do |fp, build|
|
@@ -78,8 +76,9 @@ module Bosh::Cli
|
|
78
76
|
end
|
79
77
|
|
80
78
|
@data["builds"][fingerprint] = item
|
81
|
-
if
|
82
|
-
|
79
|
+
if tmp_file_path
|
80
|
+
file_sha1 = Digest::SHA1.file(tmp_file_path).hexdigest
|
81
|
+
@data["builds"][fingerprint]["sha1"] = file_sha1
|
83
82
|
end
|
84
83
|
|
85
84
|
File.open(@index_file, "w") do |f|
|
@@ -0,0 +1 @@
|
|
1
|
+
--- {}
|
data/spec/spec_helper.rb
CHANGED
data/spec/unit/director_spec.rb
CHANGED
@@ -112,7 +112,7 @@ describe Bosh::Cli::Director do
|
|
112
112
|
@director.list_recent_tasks
|
113
113
|
|
114
114
|
@director.should_receive(:get).
|
115
|
-
with("/tasks?limit=
|
115
|
+
with("/tasks?limit=100000&verbose=1", "application/json").
|
116
116
|
and_return([200, JSON.generate([]), {}])
|
117
117
|
@director.list_recent_tasks(100000)
|
118
118
|
|
@@ -283,6 +283,31 @@ describe Bosh::Cli::Director do
|
|
283
283
|
should == ["polling result", "502"]
|
284
284
|
end
|
285
285
|
|
286
|
+
describe "not tracking trackable requests" do
|
287
|
+
it "returns without tracking/polling task if request responded with a redirect to task URL" do
|
288
|
+
options = { :arg1 => 1, :arg2 => 2 }
|
289
|
+
|
290
|
+
@director = Bosh::Cli::Director.new(DUMMY_TARGET, "user", "pass", :no_track => true)
|
291
|
+
|
292
|
+
@director.should_receive(:request).
|
293
|
+
with(:get, "/stuff", "text/plain", "abc").
|
294
|
+
and_return([302, "body", { :location => "/tasks/502" }])
|
295
|
+
|
296
|
+
tracker = mock("tracker", :track => "polling result", :output => "foo")
|
297
|
+
|
298
|
+
Bosh::Cli::TaskTracker.should_receive(:new).
|
299
|
+
with(@director, "502", options).
|
300
|
+
never
|
301
|
+
|
302
|
+
@director.request_and_track(:get, "/stuff",
|
303
|
+
{:content_type => "text/plain",
|
304
|
+
:payload => "abc",
|
305
|
+
:arg1 => 1, :arg2 => 2
|
306
|
+
}).
|
307
|
+
should == [:running, "502"]
|
308
|
+
end
|
309
|
+
end
|
310
|
+
|
286
311
|
it "considers all responses but 302 a failure" do
|
287
312
|
[200, 404, 403].each do |code|
|
288
313
|
@director.should_receive(:request).
|
@@ -321,10 +321,11 @@ describe Bosh::Cli::JobBuilder do
|
|
321
321
|
|
322
322
|
final_versions.add_version(fingerprint,
|
323
323
|
{ "version" => "4", "blobstore_id" => "12321" },
|
324
|
-
"payload")
|
324
|
+
get_tmp_file_path("payload"))
|
325
|
+
|
325
326
|
dev_versions.add_version(fingerprint,
|
326
327
|
{ "version" => "0.7-dev" },
|
327
|
-
"dev_payload")
|
328
|
+
get_tmp_file_path("dev_payload"))
|
328
329
|
|
329
330
|
builder = new_builder("foo", [], ["bar", "baz"], [])
|
330
331
|
|
@@ -226,10 +226,10 @@ describe Bosh::Cli::PackageBuilder, "dev build" do
|
|
226
226
|
|
227
227
|
final_versions.add_version(fingerprint,
|
228
228
|
{ "version" => "4", "blobstore_id" => "12321" },
|
229
|
-
"payload")
|
229
|
+
get_tmp_file_path("payload"))
|
230
230
|
dev_versions.add_version(fingerprint,
|
231
231
|
{ "version" => "0.7-dev" },
|
232
|
-
"dev_payload")
|
232
|
+
get_tmp_file_path("dev_payload"))
|
233
233
|
|
234
234
|
builder = make_builder("bar", globs)
|
235
235
|
builder.fingerprint.should == fingerprint
|
@@ -371,13 +371,17 @@ describe Bosh::Cli::PackageBuilder, "dev build" do
|
|
371
371
|
builder.build
|
372
372
|
|
373
373
|
final_index = Bosh::Cli::VersionsIndex.new(final_builds_dir)
|
374
|
-
final_index.add_version("deadbeef",
|
374
|
+
final_index.add_version("deadbeef",
|
375
|
+
{ "version" => 34 },
|
376
|
+
get_tmp_file_path("payload"))
|
375
377
|
|
376
378
|
add_file("src", "foo/foo14.rb")
|
377
379
|
builder.reload.build
|
378
380
|
builder.version.should == "34.1-dev"
|
379
381
|
|
380
|
-
final_index.add_version("deadbeef2",
|
382
|
+
final_index.add_version("deadbeef2",
|
383
|
+
{ "version" => 37 },
|
384
|
+
get_tmp_file_path("payload"))
|
381
385
|
|
382
386
|
add_file("src", "foo/foo15.rb")
|
383
387
|
builder.reload.build
|
@@ -389,7 +393,9 @@ describe Bosh::Cli::PackageBuilder, "dev build" do
|
|
389
393
|
|
390
394
|
FileUtils.rm_rf(final_builds_dir)
|
391
395
|
final_index = Bosh::Cli::VersionsIndex.new(final_builds_dir)
|
392
|
-
final_index.add_version("deadbeef3",
|
396
|
+
final_index.add_version("deadbeef3",
|
397
|
+
{ "version" => 34 },
|
398
|
+
get_tmp_file_path("payload"))
|
393
399
|
|
394
400
|
add_file("src", "foo/foo17.rb")
|
395
401
|
builder.reload.build
|
@@ -69,13 +69,17 @@ describe Bosh::Cli::ReleaseBuilder do
|
|
69
69
|
final_index = Bosh::Cli::VersionsIndex.new(File.join(@release_dir,
|
70
70
|
"releases"))
|
71
71
|
|
72
|
-
final_index.add_version("deadbeef",
|
72
|
+
final_index.add_version("deadbeef",
|
73
|
+
{ "version" => 2 },
|
74
|
+
get_tmp_file_path("payload"))
|
73
75
|
|
74
76
|
builder = new_builder
|
75
77
|
builder.version.should == "2.1-dev"
|
76
78
|
builder.build
|
77
79
|
|
78
|
-
final_index.add_version("deadbeef",
|
80
|
+
final_index.add_version("deadbeef",
|
81
|
+
{ "version" => 7 },
|
82
|
+
get_tmp_file_path("payload"))
|
79
83
|
builder = new_builder
|
80
84
|
builder.version.should == "7.1-dev"
|
81
85
|
end
|
data/spec/unit/release_spec.rb
CHANGED
@@ -151,5 +151,23 @@ describe Bosh::Cli::Release do
|
|
151
151
|
r = Bosh::Cli::Release.new(spec_asset("config/swift-rackspace"))
|
152
152
|
r.has_blobstore_secret?.should be_true
|
153
153
|
end
|
154
|
+
|
155
|
+
it "should not throw an error when merging empty secrets into options" do
|
156
|
+
r = Bosh::Cli::Release.new(spec_asset("config/local"))
|
157
|
+
opts = {
|
158
|
+
:blobstore_path => "/tmp/blobstore"
|
159
|
+
}
|
160
|
+
Bosh::Blobstore::Client.should_receive(:create).with("local", opts)
|
161
|
+
r.blobstore
|
162
|
+
end
|
163
|
+
|
164
|
+
it "throws an error when blobstore providers does not match" do
|
165
|
+
r = Bosh::Cli::Release.new(spec_asset("config/bad-providers"))
|
166
|
+
expect {
|
167
|
+
r.blobstore
|
168
|
+
}.to raise_error(Bosh::Cli::CliError, "blobstore private provider " +
|
169
|
+
"does not match final provider")
|
170
|
+
|
171
|
+
end
|
154
172
|
end
|
155
173
|
end
|
@@ -21,7 +21,9 @@ describe Bosh::Cli::VersionsIndex do
|
|
21
21
|
@index.latest_version.should be_nil
|
22
22
|
File.exists?(@index_file).should be_false
|
23
23
|
|
24
|
-
@index.add_version("deadcafe",
|
24
|
+
@index.add_version("deadcafe",
|
25
|
+
{ "version" => 2 },
|
26
|
+
get_tmp_file_path("payload2"))
|
25
27
|
File.exists?(@index_file).should be_true
|
26
28
|
end
|
27
29
|
|
@@ -44,8 +46,13 @@ describe Bosh::Cli::VersionsIndex do
|
|
44
46
|
it "can be used to add versioned payloads to index" do
|
45
47
|
item1 = { "a" => 1, "b" => 2, "version" => 1 }
|
46
48
|
item2 = { "a" => 3, "b" => 4, "version" => 2 }
|
47
|
-
|
48
|
-
@index.add_version("
|
49
|
+
|
50
|
+
@index.add_version("deadbeef",
|
51
|
+
item1,
|
52
|
+
get_tmp_file_path("payload1"))
|
53
|
+
@index.add_version("deadcafe",
|
54
|
+
item2,
|
55
|
+
get_tmp_file_path("payload2"))
|
49
56
|
|
50
57
|
@index.latest_version.should == 2
|
51
58
|
@index["deadbeef"].should ==
|
@@ -73,12 +80,14 @@ describe Bosh::Cli::VersionsIndex do
|
|
73
80
|
item2 = { "a" => 3, "b" => 4, "version" => 2 }
|
74
81
|
item3 = { "a" => 3, "b" => 4, "version" => 3 }
|
75
82
|
|
76
|
-
@index.add_version("deadbeef", item1, "payload1")
|
77
|
-
@index.add_version("deadcafe", item2, "payload2")
|
83
|
+
@index.add_version("deadbeef", item1, get_tmp_file_path("payload1"))
|
84
|
+
@index.add_version("deadcafe", item2, get_tmp_file_path("payload2"))
|
78
85
|
@index.latest_version.should == 2
|
79
|
-
@index.add_version("addedface", item3, "payload2")
|
86
|
+
@index.add_version("addedface", item3, get_tmp_file_path("payload2"))
|
80
87
|
@index.latest_version.should == 3
|
81
|
-
@index.add_version("facedbeef",
|
88
|
+
@index.add_version("facedbeef",
|
89
|
+
item1.merge("version" => "1.5"),
|
90
|
+
get_tmp_file_path("payload3"))
|
82
91
|
@index.latest_version.should == 3
|
83
92
|
end
|
84
93
|
|
@@ -87,12 +96,14 @@ describe Bosh::Cli::VersionsIndex do
|
|
87
96
|
item2 = { "a" => 3, "b" => 4, "version" => "1.8-dev" }
|
88
97
|
item3 = { "a" => 3, "b" => 4, "version" => "1.10-dev" }
|
89
98
|
|
90
|
-
@index.add_version("deadbeef", item1, "payload1")
|
91
|
-
@index.add_version("deadcafe", item2, "payload2")
|
99
|
+
@index.add_version("deadbeef", item1, get_tmp_file_path("payload1"))
|
100
|
+
@index.add_version("deadcafe", item2, get_tmp_file_path("payload2"))
|
92
101
|
@index.latest_version.should == "1.9-dev"
|
93
|
-
@index.add_version("facedead", item3, "payload2")
|
102
|
+
@index.add_version("facedead", item3, get_tmp_file_path("payload2"))
|
94
103
|
@index.latest_version.should == "1.10-dev"
|
95
|
-
@index.add_version("badbed",
|
104
|
+
@index.add_version("badbed",
|
105
|
+
item1.merge("version" => "2.15-dev"),
|
106
|
+
get_tmp_file_path("payload3"))
|
96
107
|
@index.latest_version.should == "2.15-dev"
|
97
108
|
end
|
98
109
|
|
@@ -100,10 +111,10 @@ describe Bosh::Cli::VersionsIndex do
|
|
100
111
|
item1 = { "a" => 1, "b" => 2, "version" => "1.9-dev" }
|
101
112
|
item2 = { "a" => 3, "b" => 4, "version" => "1.8-dev" }
|
102
113
|
|
103
|
-
@index.add_version("deadbeef", item1, "payload1")
|
114
|
+
@index.add_version("deadbeef", item1, get_tmp_file_path("payload1"))
|
104
115
|
|
105
116
|
lambda {
|
106
|
-
@index.add_version("deadcafe", item1, "payload3")
|
117
|
+
@index.add_version("deadcafe", item1, get_tmp_file_path("payload3"))
|
107
118
|
}.should raise_error("Trying to add duplicate version `1.9-dev' " +
|
108
119
|
"into index `#{File.join(@dir, "index.yml")}'")
|
109
120
|
end
|
@@ -112,8 +123,8 @@ describe Bosh::Cli::VersionsIndex do
|
|
112
123
|
item1 = { "a" => 1, "b" => 2, "version" => 1 }
|
113
124
|
item2 = { "a" => 3, "b" => 4, "version" => 2 }
|
114
125
|
|
115
|
-
@index.add_version("deadbeef", item1, "payload1")
|
116
|
-
@index.add_version("deadcafe", item2, "payload2")
|
126
|
+
@index.add_version("deadbeef", item1, get_tmp_file_path("payload1"))
|
127
|
+
@index.add_version("deadcafe", item2, get_tmp_file_path("payload2"))
|
117
128
|
|
118
129
|
checksum1 = Digest::SHA1.hexdigest("payload1")
|
119
130
|
checksum2 = Digest::SHA1.hexdigest("payload2")
|
@@ -124,8 +135,9 @@ describe Bosh::Cli::VersionsIndex do
|
|
124
135
|
|
125
136
|
it "supports name prefix" do
|
126
137
|
item = { "a" => 1, "b" => 2, "version" => 1 }
|
138
|
+
|
127
139
|
@index = Bosh::Cli::VersionsIndex.new(@dir, "foobar")
|
128
|
-
@index.add_version("deadbeef", item, "payload1")
|
140
|
+
@index.add_version("deadbeef", item, get_tmp_file_path("payload1"))
|
129
141
|
@index.filename(1).should == File.join(@dir, "foobar-1.tgz")
|
130
142
|
end
|
131
143
|
|
metadata
CHANGED
@@ -1,15 +1,15 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: bosh_cli
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0
|
5
|
-
prerelease:
|
4
|
+
version: '1.0'
|
5
|
+
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
8
8
|
- VMware
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2012-10-
|
12
|
+
date: 2012-10-19 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: bosh_common
|
@@ -272,8 +272,12 @@ files:
|
|
272
272
|
- spec/assets/biff/properties_template.erb
|
273
273
|
- spec/assets/config/atmos/config/final.yml
|
274
274
|
- spec/assets/config/atmos/config/private.yml
|
275
|
+
- spec/assets/config/bad-providers/config/final.yml
|
276
|
+
- spec/assets/config/bad-providers/config/private.yml
|
275
277
|
- spec/assets/config/deprecation/config/final.yml
|
276
278
|
- spec/assets/config/deprecation/config/private.yml
|
279
|
+
- spec/assets/config/local/config/final.yml
|
280
|
+
- spec/assets/config/local/config/private.yml
|
277
281
|
- spec/assets/config/s3/config/final.yml
|
278
282
|
- spec/assets/config/s3/config/private.yml
|
279
283
|
- spec/assets/config/swift-hp/config/final.yml
|
@@ -351,13 +355,16 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
351
355
|
version: '0'
|
352
356
|
segments:
|
353
357
|
- 0
|
354
|
-
hash:
|
358
|
+
hash: 418421310911129524
|
355
359
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
356
360
|
none: false
|
357
361
|
requirements:
|
358
|
-
- - ! '
|
362
|
+
- - ! '>='
|
359
363
|
- !ruby/object:Gem::Version
|
360
|
-
version:
|
364
|
+
version: '0'
|
365
|
+
segments:
|
366
|
+
- 0
|
367
|
+
hash: 418421310911129524
|
361
368
|
requirements: []
|
362
369
|
rubyforge_project:
|
363
370
|
rubygems_version: 1.8.24
|
@@ -379,8 +386,12 @@ test_files:
|
|
379
386
|
- spec/assets/biff/properties_template.erb
|
380
387
|
- spec/assets/config/atmos/config/final.yml
|
381
388
|
- spec/assets/config/atmos/config/private.yml
|
389
|
+
- spec/assets/config/bad-providers/config/final.yml
|
390
|
+
- spec/assets/config/bad-providers/config/private.yml
|
382
391
|
- spec/assets/config/deprecation/config/final.yml
|
383
392
|
- spec/assets/config/deprecation/config/private.yml
|
393
|
+
- spec/assets/config/local/config/final.yml
|
394
|
+
- spec/assets/config/local/config/private.yml
|
384
395
|
- spec/assets/config/s3/config/final.yml
|
385
396
|
- spec/assets/config/s3/config/private.yml
|
386
397
|
- spec/assets/config/swift-hp/config/final.yml
|