bosh_cli 1.3048.0 → 1.3050.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: cb2c8caf633418d93c3fc5d55e5d55829f2909d2
4
- data.tar.gz: 7d6c4f2522b87f032f687719407f8b5a308a7ee6
3
+ metadata.gz: e7a164a6a5e5dee79814a1b030c95281ef0d17cf
4
+ data.tar.gz: 3cb0f56a36a75aeb2250c4484add4e1efd93c9a8
5
5
  SHA512:
6
- metadata.gz: e176f20927bcafcf2a4ba72fff120e4d49cba0f77a2710b2c32deaccc023a907f42810a4f8f6ac0d55294718262160a4ecbe610997ac424f54c5a5621077bef7
7
- data.tar.gz: 0550e4ad1f6969805ec4f1e84b60db9c90e94ebde919977493855e84dd10636e413c6b2edf4e5213001cb66d76c4afc8f3022715e4c75a0cfc60a03a5bc28af3
6
+ metadata.gz: eed65e888f4520649fd0aeab3a3e809e2c35ae97b085b1cb4b448e4be078986ba2b07c96dba1162e4891894500d67db42f0e0358fb2be69ddfc2f5367cc69648
7
+ data.tar.gz: 19e8b853bbfa29e109442a1b32a8c14932ad7421ce5259cf17750590c6993fe77c31c1c7d55f62211ce655fca1c9ce16e55cd7e1385332fc075fcb1eceab43ac
@@ -157,6 +157,17 @@ module Bosh
157
157
  end
158
158
  end
159
159
 
160
+ def match_compiled_packages(manifest_yaml)
161
+ url = '/packages/matches_compiled'
162
+ status, body = post(url, 'text/yaml', manifest_yaml)
163
+
164
+ if status == 200
165
+ JSON.parse(body)
166
+ else
167
+ err(parse_error_message(status, body))
168
+ end
169
+ end
170
+
160
171
  def get_deployment(name)
161
172
  _, body = get_json_with_status("/deployments/#{name}")
162
173
  body
@@ -47,7 +47,7 @@ module Bosh::Cli::Command
47
47
  err("Checksum mismatch for downloaded blob `#{tarball_file_path}'")
48
48
  end
49
49
 
50
- task_report(status, task_id, "Exported Release `#{release.name.make_green}/#{release.version.make_green}` for `#{stemcell_os.make_green}/#{stemcell.version.make_green}`")
50
+ task_report(status, task_id, "Exported release `#{release.name.make_green}/#{release.version.make_green}` for `#{stemcell_os.make_green}/#{stemcell.version.make_green}`")
51
51
  end
52
52
 
53
53
  # Returns file SHA1 checksum
@@ -8,7 +8,7 @@ module Bosh::Cli::Command
8
8
  'Rebases this release onto the latest version',
9
9
  'known by director (discards local job/package',
10
10
  'versions in favor of versions assigned by director)'
11
- option '--skip-if-exists', 'skips upload if release already exists'
11
+ option '--skip-if-exists', 'no-op; retained for backward compatibility'
12
12
  def upload(release_file = nil)
13
13
  auth_required
14
14
  show_current_state
@@ -16,7 +16,6 @@ module Bosh::Cli::Command
16
16
  upload_options = {
17
17
  :rebase => options[:rebase],
18
18
  :repack => true,
19
- :skip_if_exists => options[:skip_if_exists],
20
19
  }
21
20
 
22
21
  #only check release_dir if not compiled release tarball
@@ -43,7 +42,7 @@ module Bosh::Cli::Command
43
42
  err("Release file doesn't exist")
44
43
  end
45
44
 
46
- file_type = `file --mime-type -b '#{release_file}'`
45
+ file_type = `file --mime-type -b '#{release_file}'` # duplicate? Already done on line 23
47
46
 
48
47
  if file_type =~ /text\/(plain|yaml)/
49
48
  upload_manifest(release_file, upload_options)
@@ -100,26 +99,15 @@ module Bosh::Cli::Command
100
99
  tarball_path = tarball.convert_to_old_format
101
100
  end
102
101
 
103
- remote_release = get_remote_release(tarball.release_name) rescue nil
104
- if remote_release && !rebase
105
- version = if new_director?
106
- Bosh::Common::Version::ReleaseVersion.parse(tarball.version)
107
- else
108
- tarball.version
109
- end
110
- if remote_release['versions'].include?(version.to_s)
111
- if upload_options[:skip_if_exists]
112
- say("Release `#{tarball.release_name}/#{version}' already exists. Skipping upload.")
113
- return
114
- else
115
- err('This release version has already been uploaded')
116
- end
117
- end
118
- end
102
+ Bosh::Common::Version::ReleaseVersion.parse(tarball.version) if new_director?
119
103
 
120
104
  begin
121
105
  if repack
122
- package_matches = match_remote_packages(tarball.manifest)
106
+ if tarball.compiled_release?
107
+ package_matches = match_remote_compiled_packages(tarball.manifest)
108
+ else
109
+ package_matches = match_remote_packages(tarball.manifest)
110
+ end
123
111
 
124
112
  say('Checking if can repack release for faster upload...')
125
113
  repacked_path = tarball.repack(package_matches)
@@ -161,7 +149,6 @@ module Bosh::Cli::Command
161
149
  status, task_id = director.upload_remote_release(
162
150
  release_location,
163
151
  rebase: upload_options[:rebase],
164
- skip_if_exists: upload_options[:skip_if_exists],
165
152
  )
166
153
  task_report(status, task_id, report)
167
154
  end
@@ -201,7 +188,17 @@ module Bosh::Cli::Command
201
188
  'director or downgrade your CLI to 0.19.6'
202
189
 
203
190
  say(msg.make_yellow)
204
- exit(1) unless confirmed?
191
+ end
192
+
193
+ def match_remote_compiled_packages(manifest_yaml)
194
+ director.match_compiled_packages(manifest_yaml)
195
+ rescue Bosh::Cli::DirectorError
196
+ msg = "You are using CLI >= 0.20 with director that doesn't support " +
197
+ "package matches.\nThis will result in uploading all packages " +
198
+ "and jobs to your director.\nIt is recommended to update your " +
199
+ 'director or downgrade your CLI to 0.19.6'
200
+
201
+ say(msg.make_yellow)
205
202
  end
206
203
 
207
204
  def should_convert_to_old_format?(version)
@@ -71,7 +71,6 @@ module Bosh::Cli
71
71
  return true if provider == 'local'
72
72
 
73
73
  has_legacy_secret? ||
74
- has_blobstore_secrets?(bs, "atmos", "secret") ||
75
74
  has_blobstore_secrets?(bs, "simple", "user", "password") ||
76
75
  has_blobstore_secrets?(bs, "dav", "user", "password") ||
77
76
  has_blobstore_secrets?(bs, "swift", "rackspace") ||
@@ -93,8 +92,6 @@ module Bosh::Cli
93
92
  # s3:
94
93
  # secret_access_key: ...
95
94
  # access_key_id: ...
96
- # atmos:
97
- # secret: ...
98
95
 
99
96
  # Picks blobstore client to use with current release.
100
97
  #
@@ -115,8 +112,6 @@ module Bosh::Cli
115
112
  provider = blobstore_config["provider"]
116
113
  options = blobstore_config["options"] || {}
117
114
 
118
- deprecate_blobstore_secret if has_legacy_secret?
119
-
120
115
  options = merge_private_data(provider, options)
121
116
 
122
117
  opts = Bosh::Common.symbolize_keys(options)
@@ -156,19 +151,6 @@ module Bosh::Cli
156
151
  options.merge(bs[provider] ? bs[provider] : {})
157
152
  end
158
153
 
159
- # stores blobstore_secret as blobstore.atmos.secret
160
- def deprecate_blobstore_secret
161
- say("WARNING:".make_red + " use of blobstore_secret is deprecated")
162
-
163
- @private_config["blobstore"] ||= {}
164
- bs = @private_config["blobstore"]
165
-
166
- bs["atmos"] ||= {}
167
- atmos = bs["atmos"]
168
-
169
- atmos["secret"] = @private_config["blobstore_secret"]
170
- end
171
-
172
154
  # Upgrade path for legacy clients that kept release metadata
173
155
  # in config/dev.yml and config/final.yml
174
156
  #
@@ -200,30 +182,6 @@ module Bosh::Cli
200
182
  say("Migrated dev config file format".make_green)
201
183
  end
202
184
 
203
- if @final_config.has_key?("blobstore_options") &&
204
- @final_config["blobstore_options"] != "deprecated"
205
- say("Found legacy config file `#{@final_config_file}'".make_yellow)
206
-
207
- unless @final_config["blobstore_options"]["provider"] == "atmos" &&
208
- @final_config["blobstore_options"].has_key?("atmos_options")
209
- err("Please update your release to the version " +
210
- "that uses Atmos blobstore")
211
- end
212
-
213
- new_final_config = {
214
- "final_name" => @final_config["name"],
215
- "blobstore" => {
216
- "provider" => "atmos",
217
- "options" => @final_config["blobstore_options"]["atmos_options"]
218
- },
219
- "blobstore_options" => "deprecated"
220
- }
221
-
222
- @final_config = new_final_config
223
-
224
- File.open(@final_config_file, "w") { |f| Psych.dump(@final_config, f) }
225
- say("Migrated final config file format".make_green)
226
- end
227
185
  end
228
186
 
229
187
  def load_config(file)
@@ -1,5 +1,5 @@
1
1
  module Bosh
2
2
  module Cli
3
- VERSION = '1.3048.0'
3
+ VERSION = '1.3050.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.3048.0
4
+ version: 1.3050.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-08-18 00:00:00.000000000 Z
11
+ date: 2015-08-20 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.3048.0
19
+ version: 1.3050.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.3048.0
26
+ version: 1.3050.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.3048.0
33
+ version: 1.3050.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.3048.0
40
+ version: 1.3050.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.3048.0
131
+ version: 1.3050.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.3048.0
138
+ version: 1.3050.0
139
139
  - !ruby/object:Gem::Dependency
140
140
  name: net-ssh
141
141
  requirement: !ruby/object:Gem::Requirement
@@ -306,7 +306,7 @@ dependencies:
306
306
  version: '0'
307
307
  description: |-
308
308
  BOSH CLI
309
- e2c11a
309
+ b92cdc
310
310
  email: support@cloudfoundry.com
311
311
  executables:
312
312
  - bosh
@@ -325,7 +325,6 @@ files:
325
325
  - lib/cli/blob_manager.rb
326
326
  - lib/cli/build_artifact.rb
327
327
  - lib/cli/changeset_helper.rb
328
- - lib/cli/client/compiled_packages_client.rb
329
328
  - lib/cli/client/credentials.rb
330
329
  - lib/cli/client/director.rb
331
330
  - lib/cli/client/errands_client.rb
@@ -349,9 +348,7 @@ files:
349
348
  - lib/cli/commands/complete.rb
350
349
  - lib/cli/commands/deployment.rb
351
350
  - lib/cli/commands/errand.rb
352
- - lib/cli/commands/export_compiled_packages.rb
353
351
  - lib/cli/commands/help.rb
354
- - lib/cli/commands/import_compiled_packages.rb
355
352
  - lib/cli/commands/instances.rb
356
353
  - lib/cli/commands/job.rb
357
354
  - lib/cli/commands/job_management.rb
@@ -1,28 +0,0 @@
1
- module Bosh::Cli::Client
2
- class CompiledPackagesClient
3
- def initialize(director)
4
- @director = director
5
- end
6
-
7
- def export(release_name, release_version, stemcell_name, stemcell_version)
8
- path = "/compiled_package_groups/export"
9
- content_type = 'application/json'
10
-
11
- body = JSON.dump(
12
- stemcell_name: stemcell_name,
13
- stemcell_version: stemcell_version,
14
- release_name: release_name,
15
- release_version: release_version,
16
- )
17
-
18
- _, file_path, _ = @director.post(path, content_type, body, {}, file: true)
19
- file_path
20
- end
21
-
22
- def import(exported_tar_path)
23
- path = '/compiled_package_groups/import'
24
-
25
- @director.upload_and_track(:post, path, exported_tar_path, {content_type: 'application/x-compressed'})
26
- end
27
- end
28
- end
@@ -1,34 +0,0 @@
1
- require 'fileutils'
2
- require 'cli/name_version_pair'
3
- require 'cli/client/compiled_packages_client'
4
-
5
- module Bosh::Cli::Command
6
- class ExportCompiledPackages < Base
7
- usage 'export compiled_packages'
8
- desc 'Download compiled packages for a specific release and stemcell combination'
9
- def perform(release, stemcell, download_dir)
10
- auth_required
11
- show_current_state
12
-
13
- release = Bosh::Cli::NameVersionPair.parse(release)
14
- stemcell = Bosh::Cli::NameVersionPair.parse(stemcell)
15
-
16
- unless Dir.exists?(download_dir)
17
- err("Directory `#{download_dir}' must exist.")
18
- end
19
-
20
- download_file_name = "#{release.name}-#{release.version}-#{stemcell.name}-#{stemcell.version}.tgz"
21
- download_path = File.join(download_dir, download_file_name)
22
-
23
- if File.exists?(download_path)
24
- err("File `#{download_path}' already exists.")
25
- end
26
-
27
- client = Bosh::Cli::Client::CompiledPackagesClient.new(director)
28
- tmp_path = client.export(release.name, release.version, stemcell.name, stemcell.version)
29
- FileUtils.mv(tmp_path, download_path)
30
-
31
- say("Exported compiled packages to `#{download_path.make_green}'.")
32
- end
33
- end
34
- end
@@ -1,20 +0,0 @@
1
- require 'cli/client/compiled_packages_client'
2
-
3
- module Bosh::Cli::Command
4
- class ImportCompiledPackages < Base
5
- usage 'import compiled_packages'
6
- desc 'Import compiled packages for a specific release and stemcell combination'
7
- def perform(exported_tar_path)
8
- auth_required
9
- show_current_state
10
-
11
- unless File.exist?(exported_tar_path)
12
- raise Bosh::Cli::CliError, 'Archive does not exist'
13
- end
14
-
15
- client = Bosh::Cli::Client::CompiledPackagesClient.new(director)
16
- status, task_id = client.import(exported_tar_path)
17
- task_report(status, task_id)
18
- end
19
- end
20
- end