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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 32557ab1d6e23c9cb2ee8fd385429b136da5e1ef
4
- data.tar.gz: a1acbf4c3d56114dd9a09d3e4c644a93b655e7ca
3
+ metadata.gz: 81edcb4ae995553fe264758a60ff6718dbeca5da
4
+ data.tar.gz: 7d455cc1a339f76f349d25551f84c998450c514e
5
5
  SHA512:
6
- metadata.gz: 5fdfc14255c3d2def554b49033de4151209b60a0c75542d70d205bccd71e0d3dd858c524c23e4f570246c45c1980097669294b633cb5644139ad99f4a85d9564
7
- data.tar.gz: 4e99b190fe9e2f5b1f63ade4260d2238b005bc8d7b2fa63bbacf7be9ed8a81f39e755362b7885f6d5a48e5e3f829992027e041dfa02535f1c196e057b05b2572
6
+ metadata.gz: ddca350652072a60d2935e5d50ec4548f7dc6260ba80a2115d46e4f7b49026e6dee13bc5988675248c915ace75e60b7a0e49f529742b24aec1b26a3a5e4cd0fa
7
+ data.tar.gz: 2e697aeb185516773620fd23ba21f9d65906e8177d8433eaddbb96e7f28e6883c6ced382a266aebfb3788f32a8dee4f8deafe6047b3b8aadff5a4a41ebe298ff
@@ -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(work_dir, options[:final])
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
- if deployment_name.nil?
25
- else
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(@work_dir, default_release_name, self).migrate
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(work_dir, cache_dir, release.blobstore)
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(work_dir)
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(work_dir, packages)
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(work_dir)
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
- File.open(tarball_file_path, "wb") do |file|
42
- file << File.open(tmpfile).read
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 = tarball.compiled_release? ? 'Compiled Release uploaded' : 'Release uploaded'
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
- unless in_release_dir?
160
- dir = File.expand_path('../..', manifest_path)
161
- Dir.chdir(dir)
162
- if in_release_dir?
163
- @release = Bosh::Cli::Release.new(dir, options[:final])
164
- end
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)
@@ -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
@@ -1,5 +1,5 @@
1
1
  module Bosh
2
2
  module Cli
3
- VERSION = '1.3063.0'
3
+ VERSION = '1.3068.0'
4
4
  end
5
5
  end
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.3063.0
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-01 00:00:00.000000000 Z
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.3063.0
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.3063.0
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.3063.0
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.3063.0
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.3063.0
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.3063.0
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