bosh_cli 1.3063.0 → 1.3068.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/cli/base_command.rb +16 -4
- data/lib/cli/commands/instances.rb +2 -3
- data/lib/cli/commands/release/create_release.rb +7 -6
- data/lib/cli/commands/release/export_release.rb +2 -3
- data/lib/cli/commands/release/upload_release.rb +13 -11
- data/lib/cli/release_compiler.rb +3 -5
- data/lib/cli/version.rb +1 -1
- metadata +9 -11
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 81edcb4ae995553fe264758a60ff6718dbeca5da
|
4
|
+
data.tar.gz: 7d455cc1a339f76f349d25551f84c998450c514e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ddca350652072a60d2935e5d50ec4548f7dc6260ba80a2115d46e4f7b49026e6dee13bc5988675248c915ace75e60b7a0e49f529742b24aec1b26a3a5e4cd0fa
|
7
|
+
data.tar.gz: 2e697aeb185516773620fd23ba21f9d65906e8177d8433eaddbb96e7f28e6883c6ced382a266aebfb3788f32a8dee4f8deafe6047b3b8aadff5a4a41ebe298ff
|
data/lib/cli/base_command.rb
CHANGED
@@ -46,7 +46,7 @@ module Bosh::Cli
|
|
46
46
|
def release
|
47
47
|
return @release if @release
|
48
48
|
check_if_release_dir
|
49
|
-
@release = Bosh::Cli::Release.new(
|
49
|
+
@release = Bosh::Cli::Release.new(release_directory, options[:final])
|
50
50
|
end
|
51
51
|
|
52
52
|
def progress_renderer
|
@@ -214,10 +214,22 @@ module Bosh::Cli
|
|
214
214
|
'Use the --force option to skip this check.')
|
215
215
|
end
|
216
216
|
|
217
|
+
def release_directory
|
218
|
+
return @release_directory if @release_directory
|
219
|
+
|
220
|
+
if options[:dir]
|
221
|
+
@release_directory = File.expand_path(options[:dir])
|
222
|
+
else
|
223
|
+
@release_directory = @work_dir
|
224
|
+
end
|
225
|
+
|
226
|
+
@release_directory
|
227
|
+
end
|
228
|
+
|
217
229
|
def in_release_dir?
|
218
|
-
File.directory?('packages') &&
|
219
|
-
File.directory?('jobs') &&
|
220
|
-
File.directory?('src')
|
230
|
+
File.directory?(File.join(release_directory, 'packages')) &&
|
231
|
+
File.directory?(File.join(release_directory, 'jobs')) &&
|
232
|
+
File.directory?(File.join(release_directory, 'src'))
|
221
233
|
end
|
222
234
|
|
223
235
|
def dirty_state?
|
@@ -21,9 +21,8 @@ module Bosh::Cli::Command
|
|
21
21
|
show_current_state(deployment_name)
|
22
22
|
no_track_unsupported
|
23
23
|
|
24
|
-
|
25
|
-
|
26
|
-
show_deployment deployment_name, options
|
24
|
+
unless deployment_name.nil?
|
25
|
+
show_deployment(deployment_name, options)
|
27
26
|
end
|
28
27
|
end
|
29
28
|
|
@@ -16,6 +16,7 @@ module Bosh::Cli::Command
|
|
16
16
|
option '--dry-run', 'stop before writing release manifest'
|
17
17
|
option '--name NAME', 'specify a custom release name'
|
18
18
|
option '--version VERSION', 'specify a custom version number (ex: 1.0.0 or 1.0-beta.2+dev.10)'
|
19
|
+
option '--dir RELEASE_DIRECTORY', 'path to release directory'
|
19
20
|
|
20
21
|
def create(manifest_file = nil)
|
21
22
|
check_if_release_dir
|
@@ -28,7 +29,7 @@ module Bosh::Cli::Command
|
|
28
29
|
end
|
29
30
|
|
30
31
|
say('Recreating release from the manifest')
|
31
|
-
Bosh::Cli::ReleaseCompiler.compile(manifest_file, cache_dir, release.blobstore)
|
32
|
+
Bosh::Cli::ReleaseCompiler.compile(manifest_file, cache_dir, release.blobstore, [], release.dir)
|
32
33
|
release_filename = manifest_file
|
33
34
|
else
|
34
35
|
version = options[:version]
|
@@ -55,7 +56,7 @@ module Bosh::Cli::Command
|
|
55
56
|
# can't migrate without a default release name
|
56
57
|
return if default_release_name.blank?
|
57
58
|
|
58
|
-
Bosh::Cli::Versions::MultiReleaseSupport.new(
|
59
|
+
Bosh::Cli::Versions::MultiReleaseSupport.new(release.dir, default_release_name, self).migrate
|
59
60
|
end
|
60
61
|
|
61
62
|
def create_from_spec(version)
|
@@ -139,7 +140,7 @@ module Bosh::Cli::Command
|
|
139
140
|
end
|
140
141
|
|
141
142
|
def archive_repository_provider
|
142
|
-
@archive_repository_provider ||= Bosh::Cli::ArchiveRepositoryProvider.new(
|
143
|
+
@archive_repository_provider ||= Bosh::Cli::ArchiveRepositoryProvider.new(release.dir, cache_dir, release.blobstore)
|
143
144
|
end
|
144
145
|
|
145
146
|
def build_release(job_artifacts, manifest_only, package_artifacts, license_artifacts, name, version)
|
@@ -163,7 +164,7 @@ module Bosh::Cli::Command
|
|
163
164
|
end
|
164
165
|
|
165
166
|
def build_packages
|
166
|
-
packages = Bosh::Cli::Resources::Package.discover(
|
167
|
+
packages = Bosh::Cli::Resources::Package.discover(release.dir)
|
167
168
|
artifacts = packages.map do |package|
|
168
169
|
say("Building #{package.name.make_green}...")
|
169
170
|
artifact = archive_builder.build(package)
|
@@ -189,7 +190,7 @@ module Bosh::Cli::Command
|
|
189
190
|
end
|
190
191
|
|
191
192
|
def build_jobs(packages)
|
192
|
-
jobs = Bosh::Cli::Resources::Job.discover(
|
193
|
+
jobs = Bosh::Cli::Resources::Job.discover(release.dir, packages)
|
193
194
|
artifacts = jobs.map do |job|
|
194
195
|
say("Building #{job.name.make_green}...")
|
195
196
|
artifact = archive_builder.build(job)
|
@@ -201,7 +202,7 @@ module Bosh::Cli::Command
|
|
201
202
|
end
|
202
203
|
|
203
204
|
def build_licenses
|
204
|
-
licenses = Bosh::Cli::Resources::License.discover(
|
205
|
+
licenses = Bosh::Cli::Resources::License.discover(release.dir)
|
205
206
|
artifacts = licenses.map do |license|
|
206
207
|
say("Building #{'license'.make_green}...")
|
207
208
|
artifact = archive_builder.build(license)
|
@@ -38,9 +38,8 @@ module Bosh::Cli::Command
|
|
38
38
|
nl
|
39
39
|
progress_renderer.start(tarball_file_name, "downloading...")
|
40
40
|
tmpfile = director.download_resource(tarball_blobstore_id)
|
41
|
-
|
42
|
-
|
43
|
-
end
|
41
|
+
|
42
|
+
FileUtils.move(tmpfile, tarball_file_path)
|
44
43
|
progress_renderer.finish(tarball_file_name, "downloaded")
|
45
44
|
|
46
45
|
if file_checksum(tarball_file_path) != tarball_sha1
|
@@ -9,6 +9,8 @@ module Bosh::Cli::Command
|
|
9
9
|
'known by director (discards local job/package',
|
10
10
|
'versions in favor of versions assigned by director)'
|
11
11
|
option '--skip-if-exists', 'no-op; retained for backward compatibility'
|
12
|
+
option '--dir RELEASE_DIRECTORY', 'path to release directory'
|
13
|
+
|
12
14
|
def upload(release_file = nil)
|
13
15
|
auth_required
|
14
16
|
show_current_state
|
@@ -62,7 +64,7 @@ module Bosh::Cli::Command
|
|
62
64
|
blobstore = release.blobstore
|
63
65
|
tmpdir = Dir.mktmpdir
|
64
66
|
|
65
|
-
compiler = Bosh::Cli::ReleaseCompiler.new(manifest_path, cache_dir, blobstore, package_matches)
|
67
|
+
compiler = Bosh::Cli::ReleaseCompiler.new(manifest_path, cache_dir, blobstore, package_matches, release.dir)
|
66
68
|
need_repack = true
|
67
69
|
|
68
70
|
unless compiler.exists?
|
@@ -129,7 +131,7 @@ module Bosh::Cli::Command
|
|
129
131
|
report = 'Release rebased'
|
130
132
|
else
|
131
133
|
say("\nUploading release\n")
|
132
|
-
report =
|
134
|
+
report = 'Release uploaded'
|
133
135
|
end
|
134
136
|
|
135
137
|
status, task_id = director.upload_release(tarball_path, {rebase: rebase})
|
@@ -153,17 +155,17 @@ module Bosh::Cli::Command
|
|
153
155
|
task_report(status, task_id, report)
|
154
156
|
end
|
155
157
|
|
156
|
-
# if we aren't already in a release directory, try going up two levels
|
157
|
-
# to see if that is a release directory, and then use that as the base
|
158
158
|
def find_release_dir(manifest_path)
|
159
|
-
|
160
|
-
|
161
|
-
|
162
|
-
|
163
|
-
|
164
|
-
|
159
|
+
release_dir_for_final_manfiest = File.expand_path('../..', manifest_path)
|
160
|
+
release_dir_for_dev_manfiest = File.expand_path('../../..', manifest_path)
|
161
|
+
|
162
|
+
[
|
163
|
+
release_dir_for_final_manfiest,
|
164
|
+
release_dir_for_dev_manfiest
|
165
|
+
].each do |release_dir|
|
166
|
+
@release_directory = release_dir
|
167
|
+
break if in_release_dir?
|
165
168
|
end
|
166
|
-
|
167
169
|
end
|
168
170
|
|
169
171
|
def get_remote_release(name)
|
data/lib/cli/release_compiler.rb
CHANGED
@@ -6,8 +6,8 @@ module Bosh::Cli
|
|
6
6
|
|
7
7
|
attr_writer :tarball_path
|
8
8
|
|
9
|
-
def self.compile(manifest_file, artifacts_dir, blobstore)
|
10
|
-
new(manifest_file, artifacts_dir, blobstore).compile
|
9
|
+
def self.compile(manifest_file, artifacts_dir, blobstore, package_matches, release_source)
|
10
|
+
new(manifest_file, artifacts_dir, blobstore, package_matches, release_source).compile
|
11
11
|
end
|
12
12
|
|
13
13
|
# @param [String] manifest_file Release manifest path
|
@@ -15,9 +15,7 @@ module Bosh::Cli
|
|
15
15
|
# @param [Array] package_matches List of package checksums that director
|
16
16
|
# can match
|
17
17
|
# @param [String] release_source Release directory
|
18
|
-
def initialize(manifest_file, artifacts_dir, blobstore,
|
19
|
-
package_matches = [], release_source = nil)
|
20
|
-
|
18
|
+
def initialize(manifest_file, artifacts_dir, blobstore, package_matches, release_source)
|
21
19
|
@blobstore = blobstore
|
22
20
|
@release_source = release_source || Dir.pwd
|
23
21
|
@manifest_path = File.expand_path(manifest_file, @release_source)
|
data/lib/cli/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: bosh_cli
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.
|
4
|
+
version: 1.3068.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- VMware
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-09-
|
11
|
+
date: 2015-09-03 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bosh_common
|
@@ -16,28 +16,28 @@ dependencies:
|
|
16
16
|
requirements:
|
17
17
|
- - "~>"
|
18
18
|
- !ruby/object:Gem::Version
|
19
|
-
version: 1.
|
19
|
+
version: 1.3068.0
|
20
20
|
type: :runtime
|
21
21
|
prerelease: false
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
23
23
|
requirements:
|
24
24
|
- - "~>"
|
25
25
|
- !ruby/object:Gem::Version
|
26
|
-
version: 1.
|
26
|
+
version: 1.3068.0
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
28
|
name: bosh-template
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
30
30
|
requirements:
|
31
31
|
- - "~>"
|
32
32
|
- !ruby/object:Gem::Version
|
33
|
-
version: 1.
|
33
|
+
version: 1.3068.0
|
34
34
|
type: :runtime
|
35
35
|
prerelease: false
|
36
36
|
version_requirements: !ruby/object:Gem::Requirement
|
37
37
|
requirements:
|
38
38
|
- - "~>"
|
39
39
|
- !ruby/object:Gem::Version
|
40
|
-
version: 1.
|
40
|
+
version: 1.3068.0
|
41
41
|
- !ruby/object:Gem::Dependency
|
42
42
|
name: cf-uaa-lib
|
43
43
|
requirement: !ruby/object:Gem::Requirement
|
@@ -128,14 +128,14 @@ dependencies:
|
|
128
128
|
requirements:
|
129
129
|
- - "~>"
|
130
130
|
- !ruby/object:Gem::Version
|
131
|
-
version: 1.
|
131
|
+
version: 1.3068.0
|
132
132
|
type: :runtime
|
133
133
|
prerelease: false
|
134
134
|
version_requirements: !ruby/object:Gem::Requirement
|
135
135
|
requirements:
|
136
136
|
- - "~>"
|
137
137
|
- !ruby/object:Gem::Version
|
138
|
-
version: 1.
|
138
|
+
version: 1.3068.0
|
139
139
|
- !ruby/object:Gem::Dependency
|
140
140
|
name: net-ssh
|
141
141
|
requirement: !ruby/object:Gem::Requirement
|
@@ -304,9 +304,7 @@ dependencies:
|
|
304
304
|
- - ">="
|
305
305
|
- !ruby/object:Gem::Version
|
306
306
|
version: '0'
|
307
|
-
description:
|
308
|
-
BOSH CLI
|
309
|
-
ac5134
|
307
|
+
description: BOSH CLI
|
310
308
|
email: support@cloudfoundry.com
|
311
309
|
executables:
|
312
310
|
- bosh
|