bosh-director 1.5.0.pre.1210 → 1.5.0.pre.1211
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/bosh/director/api/controller.rb +2 -0
- data/lib/bosh/director/api/controllers/compiled_packages_controller.rb +6 -1
- data/lib/bosh/director/compiled_package_downloader.rb +15 -8
- data/lib/bosh/director/compiled_package_group.rb +1 -3
- data/lib/bosh/director/compiled_packages_exporter.rb +5 -4
- data/lib/bosh/director/version.rb +1 -1
- metadata +17 -17
@@ -8,6 +8,7 @@ require 'bosh/director/api/controllers/resurrection_controller'
|
|
8
8
|
require 'bosh/director/api/controllers/stemcells_controller'
|
9
9
|
require 'bosh/director/api/controllers/tasks_controller'
|
10
10
|
require 'bosh/director/api/controllers/users_controller'
|
11
|
+
require 'bosh/director/api/controllers/compiled_packages_controller'
|
11
12
|
|
12
13
|
module Bosh::Director
|
13
14
|
module Api
|
@@ -22,6 +23,7 @@ module Bosh::Director
|
|
22
23
|
use Controllers::StemcellsController
|
23
24
|
use Controllers::TasksController
|
24
25
|
use Controllers::UsersController
|
26
|
+
use Controllers::CompiledPackagesController
|
25
27
|
end
|
26
28
|
end
|
27
29
|
end
|
@@ -15,9 +15,14 @@ module Bosh::Director
|
|
15
15
|
release_version = release_manager.find_version(release, params[:release_version])
|
16
16
|
|
17
17
|
compiled_packages = CompiledPackageGroup.new(release_version, stemcell)
|
18
|
+
output_dir = File.join(Dir.tmpdir, 'compiled_packages')
|
19
|
+
FileUtils.mkdir_p(output_dir)
|
18
20
|
exporter = CompiledPackagesExporter.new(compiled_packages, App.instance.blobstores.blobstore)
|
19
21
|
|
20
|
-
|
22
|
+
output_path = File.join(output_dir, "compiled_packages_#{Time.now.to_f}.tar.gz")
|
23
|
+
exporter.export(output_path)
|
24
|
+
|
25
|
+
send_file output_path, type: :tgz
|
21
26
|
end
|
22
27
|
end
|
23
28
|
end
|
@@ -1,3 +1,4 @@
|
|
1
|
+
require 'fileutils'
|
1
2
|
require 'tmpdir'
|
2
3
|
|
3
4
|
module Bosh::Director
|
@@ -8,28 +9,34 @@ module Bosh::Director
|
|
8
9
|
end
|
9
10
|
|
10
11
|
def download
|
11
|
-
|
12
|
+
@download_dir = Dir.mktmpdir
|
12
13
|
|
13
14
|
compiled_packages = {'compiled_packages' => []}
|
14
|
-
|
15
|
+
FileUtils.mkdir_p(File.join(@download_dir, 'compiled_packages', 'blobs'))
|
15
16
|
|
16
17
|
@compiled_package_group.compiled_packages.each do |compiled_package|
|
17
18
|
blobstore_id = compiled_package.blobstore_id
|
18
19
|
|
19
20
|
compiled_packages['compiled_packages'] << {
|
20
|
-
'
|
21
|
-
'
|
22
|
-
'
|
21
|
+
'package_name' => compiled_package.package.name,
|
22
|
+
'package_fingerprint' => compiled_package.package.fingerprint,
|
23
|
+
'stemcell_sha1' => @compiled_package_group.stemcell_sha1,
|
23
24
|
'blobstore_id' => blobstore_id,
|
24
25
|
}
|
25
|
-
compiled_package_blob = File.open(File.join(
|
26
|
+
compiled_package_blob = File.open(File.join(@download_dir, 'compiled_packages', 'blobs', blobstore_id), 'w')
|
26
27
|
@blobstore_client.get(blobstore_id, compiled_package_blob)
|
27
28
|
compiled_package_blob.close
|
28
29
|
end
|
29
30
|
|
30
|
-
File.open(File.join(
|
31
|
+
File.open(File.join(@download_dir, 'compiled_packages', 'compiled_packages.yml'), 'w') do |f|
|
32
|
+
f.write(YAML.dump(compiled_packages))
|
33
|
+
end
|
34
|
+
|
35
|
+
@download_dir
|
36
|
+
end
|
31
37
|
|
32
|
-
|
38
|
+
def cleanup
|
39
|
+
FileUtils.rm_rf(@download_dir)
|
33
40
|
end
|
34
41
|
end
|
35
42
|
end
|
@@ -1,5 +1,3 @@
|
|
1
|
-
require 'bosh/director/models/compiled_package'
|
2
|
-
|
3
1
|
module Bosh::Director
|
4
2
|
class CompiledPackageGroup
|
5
3
|
def initialize(release_version, stemcell)
|
@@ -17,7 +15,7 @@ module Bosh::Director
|
|
17
15
|
end.compact
|
18
16
|
end
|
19
17
|
|
20
|
-
def
|
18
|
+
def stemcell_sha1
|
21
19
|
@stemcell.sha1
|
22
20
|
end
|
23
21
|
end
|
@@ -8,14 +8,15 @@ module Bosh::Director
|
|
8
8
|
@blobstore_client = blobstore_client
|
9
9
|
end
|
10
10
|
|
11
|
-
def
|
11
|
+
def export(output_path)
|
12
12
|
downloader = CompiledPackageDownloader.new(@compiled_package_group, @blobstore_client)
|
13
13
|
download_dir = downloader.download
|
14
|
-
download_path = File.join(download_dir, 'compiled_packages.tgz')
|
15
14
|
|
16
|
-
TarGzipper.new.compress(download_dir, '
|
15
|
+
TarGzipper.new.compress(download_dir, 'compiled_packages', output_path)
|
17
16
|
|
18
|
-
|
17
|
+
downloader.cleanup
|
18
|
+
|
19
|
+
nil
|
19
20
|
end
|
20
21
|
end
|
21
22
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: bosh-director
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.5.0.pre.
|
4
|
+
version: 1.5.0.pre.1211
|
5
5
|
prerelease: 6
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2013-10-
|
12
|
+
date: 2013-10-31 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: bcrypt-ruby
|
@@ -34,7 +34,7 @@ dependencies:
|
|
34
34
|
requirements:
|
35
35
|
- - ~>
|
36
36
|
- !ruby/object:Gem::Version
|
37
|
-
version: 1.5.0.pre.
|
37
|
+
version: 1.5.0.pre.1211
|
38
38
|
type: :runtime
|
39
39
|
prerelease: false
|
40
40
|
version_requirements: !ruby/object:Gem::Requirement
|
@@ -42,7 +42,7 @@ dependencies:
|
|
42
42
|
requirements:
|
43
43
|
- - ~>
|
44
44
|
- !ruby/object:Gem::Version
|
45
|
-
version: 1.5.0.pre.
|
45
|
+
version: 1.5.0.pre.1211
|
46
46
|
- !ruby/object:Gem::Dependency
|
47
47
|
name: bosh-core
|
48
48
|
requirement: !ruby/object:Gem::Requirement
|
@@ -50,7 +50,7 @@ dependencies:
|
|
50
50
|
requirements:
|
51
51
|
- - ~>
|
52
52
|
- !ruby/object:Gem::Version
|
53
|
-
version: 1.5.0.pre.
|
53
|
+
version: 1.5.0.pre.1211
|
54
54
|
type: :runtime
|
55
55
|
prerelease: false
|
56
56
|
version_requirements: !ruby/object:Gem::Requirement
|
@@ -58,7 +58,7 @@ dependencies:
|
|
58
58
|
requirements:
|
59
59
|
- - ~>
|
60
60
|
- !ruby/object:Gem::Version
|
61
|
-
version: 1.5.0.pre.
|
61
|
+
version: 1.5.0.pre.1211
|
62
62
|
- !ruby/object:Gem::Dependency
|
63
63
|
name: bosh_common
|
64
64
|
requirement: !ruby/object:Gem::Requirement
|
@@ -66,7 +66,7 @@ dependencies:
|
|
66
66
|
requirements:
|
67
67
|
- - ~>
|
68
68
|
- !ruby/object:Gem::Version
|
69
|
-
version: 1.5.0.pre.
|
69
|
+
version: 1.5.0.pre.1211
|
70
70
|
type: :runtime
|
71
71
|
prerelease: false
|
72
72
|
version_requirements: !ruby/object:Gem::Requirement
|
@@ -74,7 +74,7 @@ dependencies:
|
|
74
74
|
requirements:
|
75
75
|
- - ~>
|
76
76
|
- !ruby/object:Gem::Version
|
77
|
-
version: 1.5.0.pre.
|
77
|
+
version: 1.5.0.pre.1211
|
78
78
|
- !ruby/object:Gem::Dependency
|
79
79
|
name: bosh_cpi
|
80
80
|
requirement: !ruby/object:Gem::Requirement
|
@@ -82,7 +82,7 @@ dependencies:
|
|
82
82
|
requirements:
|
83
83
|
- - ~>
|
84
84
|
- !ruby/object:Gem::Version
|
85
|
-
version: 1.5.0.pre.
|
85
|
+
version: 1.5.0.pre.1211
|
86
86
|
type: :runtime
|
87
87
|
prerelease: false
|
88
88
|
version_requirements: !ruby/object:Gem::Requirement
|
@@ -90,7 +90,7 @@ dependencies:
|
|
90
90
|
requirements:
|
91
91
|
- - ~>
|
92
92
|
- !ruby/object:Gem::Version
|
93
|
-
version: 1.5.0.pre.
|
93
|
+
version: 1.5.0.pre.1211
|
94
94
|
- !ruby/object:Gem::Dependency
|
95
95
|
name: bosh_openstack_cpi
|
96
96
|
requirement: !ruby/object:Gem::Requirement
|
@@ -98,7 +98,7 @@ dependencies:
|
|
98
98
|
requirements:
|
99
99
|
- - ~>
|
100
100
|
- !ruby/object:Gem::Version
|
101
|
-
version: 1.5.0.pre.
|
101
|
+
version: 1.5.0.pre.1211
|
102
102
|
type: :runtime
|
103
103
|
prerelease: false
|
104
104
|
version_requirements: !ruby/object:Gem::Requirement
|
@@ -106,7 +106,7 @@ dependencies:
|
|
106
106
|
requirements:
|
107
107
|
- - ~>
|
108
108
|
- !ruby/object:Gem::Version
|
109
|
-
version: 1.5.0.pre.
|
109
|
+
version: 1.5.0.pre.1211
|
110
110
|
- !ruby/object:Gem::Dependency
|
111
111
|
name: bosh_aws_cpi
|
112
112
|
requirement: !ruby/object:Gem::Requirement
|
@@ -114,7 +114,7 @@ dependencies:
|
|
114
114
|
requirements:
|
115
115
|
- - ~>
|
116
116
|
- !ruby/object:Gem::Version
|
117
|
-
version: 1.5.0.pre.
|
117
|
+
version: 1.5.0.pre.1211
|
118
118
|
type: :runtime
|
119
119
|
prerelease: false
|
120
120
|
version_requirements: !ruby/object:Gem::Requirement
|
@@ -122,7 +122,7 @@ dependencies:
|
|
122
122
|
requirements:
|
123
123
|
- - ~>
|
124
124
|
- !ruby/object:Gem::Version
|
125
|
-
version: 1.5.0.pre.
|
125
|
+
version: 1.5.0.pre.1211
|
126
126
|
- !ruby/object:Gem::Dependency
|
127
127
|
name: bosh_vsphere_cpi
|
128
128
|
requirement: !ruby/object:Gem::Requirement
|
@@ -130,7 +130,7 @@ dependencies:
|
|
130
130
|
requirements:
|
131
131
|
- - ~>
|
132
132
|
- !ruby/object:Gem::Version
|
133
|
-
version: 1.5.0.pre.
|
133
|
+
version: 1.5.0.pre.1211
|
134
134
|
type: :runtime
|
135
135
|
prerelease: false
|
136
136
|
version_requirements: !ruby/object:Gem::Requirement
|
@@ -138,7 +138,7 @@ dependencies:
|
|
138
138
|
requirements:
|
139
139
|
- - ~>
|
140
140
|
- !ruby/object:Gem::Version
|
141
|
-
version: 1.5.0.pre.
|
141
|
+
version: 1.5.0.pre.1211
|
142
142
|
- !ruby/object:Gem::Dependency
|
143
143
|
name: eventmachine
|
144
144
|
requirement: !ruby/object:Gem::Requirement
|
@@ -445,7 +445,7 @@ dependencies:
|
|
445
445
|
version: '1.0'
|
446
446
|
description: ! 'BOSH Director
|
447
447
|
|
448
|
-
|
448
|
+
d1557f'
|
449
449
|
email: support@cloudfoundry.com
|
450
450
|
executables:
|
451
451
|
- bosh-director
|