omnibus 4.0.0.rc.2 → 4.0.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: 67c9874074d2cec13ed5734f8e6f420ccfb157d7
4
- data.tar.gz: 9fff24c7c26e8ef92175dac8c01b5c0883e2e2e1
3
+ metadata.gz: 42ba84e6247d1cec8f21fb01ec6324e850a1e10e
4
+ data.tar.gz: 74c043e787a3728d746c282cadb46ed4024cb99c
5
5
  SHA512:
6
- metadata.gz: e2bbe215dd2606a272c04d1be03126d67cf0db748032616cfee7d699f355fef833f3d7b7bc29767c57bcd7e9c4dba8e1fde145d412ef8eb00b9d2eecbe53a9f0
7
- data.tar.gz: 250b20df2e0c254335c29e0fb4490a764e8ce52044804e057c625b75034b638d868d3d91cb7b0593bf18742daf010187cb7f2e9b41a52b7a006fbe3c75d3129b
6
+ metadata.gz: 954792cc931a139486c646236e63c8d1a87c9f8841600918c769d262d943e886ed85fa7698b543acc6c0385849a55ea620331b6220812b2c57fcc9039192fa9c
7
+ data.tar.gz: 81830612f63dc5664bd3257c9b232911c1730af9f0d3b7f31f53684424272d34262b9e154013caacc4f05c51531e25a3b382539a888fb49ac7ddf39a057cf69e
@@ -1,63 +1,8 @@
1
1
  Omnibus CHANGELOG
2
2
  =================
3
3
 
4
- v4.0.0.rc.2 (November 10, 2014)
5
- -------------------------------
6
-
7
- ### New Features
8
-
9
- #### Platforms
10
- - Raspberry Pi platform support (currently Raspbian and Pidora)
11
- - AIX
12
- - XL C is the default compiler on AIX.
13
- - FreeBSD 10
14
- - Clang is the default compiler on FreeBSD 10+
15
- - Add `libgcc` and `libelf` to the FreeBSD whitelist
16
- - Solaris
17
- - Make compilation default `-static-libgcc`
18
-
19
- ### Bugfixes
20
-
21
- - Set default values for `CXXFLAGS`.
22
- - Retrieve the correct path_key from the ENV on Windows.
23
- - openSUSE/SLES fixes for OHAI-339.
24
- - Properly truncate platform version on Arch Linux.
25
- - Ensure final `*.dmg` name matches actual `*.pkg` name.
26
- - Change `makeself` package extension back to `.sh`.
27
- - Generate a default `makeselfinst` which fires at following install.
28
- - Map `Omnibus::Project#replaces` to RPM Spec file's `Obsoletes:`.
29
-
30
- v4.0.0.rc.1 (September 23, 2014)
31
- --------------------------------
32
-
33
- ### New Features
34
- - Expose `build_version` to all `pkg` templates
35
- - Improve info messages during RPM creation
36
- - Make PKG packager aware of scripts with default Omnibus naming
37
- - Make RPM packager aware of scripts with default Omnibus naming
38
- - Clean up script logic in BFF packager
39
- - Add an option for configuring Fetcher read timeout
40
-
41
- ### DSL Changes
42
- #### Builder
43
- - Add an `appbundle` function to the builder DSL
44
-
45
- #### Packager
46
- - Expose `install_dir` in Packager DSL
47
- - Expose `windows_safe_path` in Packager DSL
48
-
49
- ### Bugfixes
50
- - Replace dashes with underscores in RPM version names.
51
- - The achitecture of deb package is i386, not i686.
52
- - Re-ignore 204 exit code from `light.exe`
53
- - Use single quotes in main `rpmbuild` command
54
- - Be sure to create and sign the RPM if `~/.rpmmacros` exists
55
- - Switch to OpenSSL::Digest which is threadsafe on 2.1.2
56
- - Ensure `GitFetcher` properly resolves remote refs
57
- - Ensure we clean ALL Ruby environment vars
58
-
59
- v4.0.0.beta.1 (August 20, 2014)
60
- -------------------------------
4
+ v4.0.0 (December 15, 2014)
5
+ --------------------------
61
6
  ### New Features
62
7
  - Implement packager-specific DSLs. Packagers now define their own custom methods that may be configured using the `package` block in a project file. For more information, please see the README or any of the embedded "Building on X" documents.
63
8
  - Use vendored assets. In previous versions of Omnibus, the generator would create resource assets for DMG, PKG, and MSI packages, regardless of whether you intended to build those packages. This could cause repo bloat and information overload. In Omnibus 4, the default generator does not create these assets, and instead prefers "general" vendored assets. If you are planning to make a resource-intensive package (such as a PKG or MSI), it is encouraged you generate these assets by specifing the `--pkg-assets` flag during project generation. Omnibus will prefer local resources in the `resources/` directory and then fall-back to "sane" defaults which are vendored within Omnibus.
@@ -101,6 +46,8 @@ v4.0.0.beta.1 (August 20, 2014)
101
46
  - Added `Config.workers` key for specifying the maximum number of parallel events to take place.
102
47
  - Added parallel downloads for fetcher objects.
103
48
  - Use `fakeroot` for building DEBs and RPMs.
49
+ - Raspberry Pi platform support (Raspian, Pidora).
50
+ - Retry uploads to Artifactory on publish failures.
104
51
 
105
52
  ### Potentially Breaking Changes
106
53
  - Remove embedded functional tests. Because the functional tests were skipped on CI (and require a system of each type to properly execute), they have been removed. Chef has created the [omnibus-harmony](https://github.com/opscode/omnibus-harmony) pipeline to perform true integration testing using the in-house CI cluster. If you were relying on the integration tests (or the associated Rake tasks), they have been removed.
@@ -133,6 +80,10 @@ v4.0.0.beta.1 (August 20, 2014)
133
80
  - Truncate SLES and other RedHat derivatives platform version.
134
81
  - Refactor logger objects to separate Omnibus internal debugging info with build/compile/configure debugging info.
135
82
  - Improve error and debugging output when an exception is raised while shelling out. Failed shell commands will now raise `Omnibus::CommandFailed` and `Omnibus::CommandTimeout` instead of the `Mixlib::ShellOut` exceptions. If you were previously rescuing the Mixlib exceptions, you should switch to the new ones.
83
+ - XL C is now the default compiler on AIX
84
+ - Clang is now the default compiler on FreeBSD 10+
85
+ - Make compilation default `-static-libgcc` on Solaris
86
+ - Only allow installation on system volume for Mac OS X PKGs.
136
87
 
137
88
  ### Definitely Breaking Changes
138
89
  - Previously deprecated methods have been removed.
@@ -194,6 +145,8 @@ v4.0.0.beta.1 (August 20, 2014)
194
145
  - Removed `Project#machine`. Use `ohai` instead.
195
146
  - Removed `Project#dependencies`. List each dependency using `dependency` instead.
196
147
  - Added `Project#ohai` for quick access to Ohai data.
148
+
149
+ #### Software
197
150
  - Removed `Software#override_version`. There is no replacement.
198
151
  - Removed `Software#install_dir`. Please use `Software#install_path` instead.
199
152
  - Removed `Software#platform_version`. Use `ohai` instead.
@@ -205,10 +158,15 @@ v4.0.0.beta.1 (August 20, 2014)
205
158
  - Removed `Software#source_dir`. You can use `Omnibus::Config.source_dir` instead, but if you need access to this method, it is probably a bug in Omnibus.
206
159
  - Removed `Software#cache_dir`. You can use `Omnibus::Config.cache_dir` instead, but if you need access to this method, it is probably a bug in Omnibus.
207
160
  - Removed `Software#config`. You can use `Omnibus::Config` instead.
161
+
162
+ #### Builder
208
163
  - Added `Builder#make` for choosing the correct `make` binary on the system. When `gmake` is present, it is preferred. The use of this method also sets the `MAKE` environment variable for consistency. You should change all instances of `command "make ..."` to `make "..."` to ensure true cross-platform building.
209
164
  - Added `Builder#windows_safe_path` for shelling out to the system with the correct path separators.
210
165
  - Added `Buidler#workers` for delegation to the config option.
211
166
  - Removed `Buidler#max_build_jobs` in favor of `Builder#workers`.
167
+ - Add an `Builder#appbundle` function to the builder DSL
168
+
169
+ #### Packagers
212
170
  - Added `Packager::DEB#vendor` for specifying the package vendor.
213
171
  - Added `Packager::DEB#license` for specifying the package license.
214
172
  - Added `Packager::DEB#priority` for specifying the package priority.
@@ -233,7 +191,9 @@ v4.0.0.beta.1 (August 20, 2014)
233
191
  - Standardized license headers.
234
192
  - Added SSH forwarding as part of the default generated `.kitchen.yml`.
235
193
  - Updated Chef version in generated `.kitchen.yml`.
236
-
194
+ - Switch to OpenSSL::Digest which is threadsafe on 2.1.2
195
+ - Ensure final `*.dmg` name matches actual `*.pkg` name.
196
+ - Replace dashes (`-`) with tildes (`~`) in DEB and RPM versions
237
197
 
238
198
  v3.2.1 (July 26, 2014)
239
199
  ----------------------
data/README.md CHANGED
@@ -39,10 +39,10 @@ You can now create an Omnibus project in your current directory by using the pro
39
39
  $ omnibus new $MY_PROJECT_NAME
40
40
  ```
41
41
 
42
- This will generate a complete project skeleton in the directory `$MY_PROJECT_NAME`
42
+ This will generate a complete project skeleton in the directory `omnibus-$MY_PROJECT_NAME`
43
43
 
44
44
  ```bash
45
- $ cd $MY_PROJECT_NAME
45
+ $ cd omnibus-$MY_PROJECT_NAME
46
46
  $ bundle install --binstubs
47
47
  $ bin/omnibus build $MY_PROJECT_NAME
48
48
  ```
@@ -13,9 +13,9 @@ A number of project configuration values are taken into consideration for buildi
13
13
 
14
14
  These values are interpolated and evaluated using Omnibus' internal DEB templates. For 99% of users, these templates should be satisfactory. If you encounter an instance where Omnibus' ERB templates do not satisfy a use case, please open an issue.
15
15
 
16
- Because of the unlikelihood of their necessity, Omnibus does not generate deb-related assets. If you find yourself in a situation where you need to generate highly-customized DEB assets, run the Omnibus generator command with the `--deb-assets` flag:
16
+ Because of the unlikelihood of their necessity, Omnibus does not generate deb-related assets. If you find yourself in a situation where you need to generate highly-customized DEB assets, run the Omnibus new command with the `--deb-assets` flag:
17
17
 
18
- $ omnibus generate NAME --deb-assets
18
+ $ omnibus new NAME --deb-assets
19
19
 
20
20
  **If this is an existing project, be sure to answer "NO" when asked if you want to overwrite existing files!**
21
21
 
@@ -8,9 +8,9 @@ Building a .pkg
8
8
  In Mac OS X, a `.pkg` is a special file that is read by Installer.app that contains the set of instructions for installating a piece of software on a target system.
9
9
 
10
10
  ### Requirements
11
- By default, Omnibus does not generate pkg-related assets. To generate the pkg assets, run the Omnibus generator command with the `--pkg-assets` flag:
11
+ By default, Omnibus does not generate pkg-related assets. To generate the pkg assets, run the Omnibus new command with the `--pkg-assets` flag:
12
12
 
13
- $ omnibus generate NAME --pkg-assets
13
+ $ omnibus new NAME --pkg-assets
14
14
 
15
15
  **If this is an existing project, be sure to answer "NO" when asked if you want to overwrite existing files!**
16
16
 
@@ -53,9 +53,9 @@ Building a .dmg
53
53
  In Mac OSX, a `.dmg` is a compressed wrapper around a collection of resources, often including a `.pkg`. The possibilities for creating and customizing a DMG are endless, but Omnibus provides a"basic starter case that will generate a pretty DMG that contains the `.pkg` file it creates.
54
54
 
55
55
  ### Requirements
56
- By default, Omnibus does not generate dmg-related assets. To generate the dmg assets, run the Omnibus generator with the `--dmg-assets` flag:
56
+ By default, Omnibus does not generate dmg-related assets. To generate the dmg assets, run the Omnibus new with the `--dmg-assets` flag:
57
57
 
58
- $ omnibus generate NAME --dmg-assets
58
+ $ omnibus new NAME --dmg-assets
59
59
 
60
60
  **If this is an existing project, be sure to answer "NO" when asked if you want to overwrite existing files!**
61
61
 
@@ -31,9 +31,9 @@ These options are further described in the [`Project` documentation](http://ruby
31
31
 
32
32
  These values are interpolated and evaluated using Omnibus' internal RPM templates. For 99% of users, these templates should be satisfactory. If you encounter an instance where Omnibus' RPM templates do not satisfy a use case, please open an issue.
33
33
 
34
- Because of the unlikelihood of their necessity, Omnibus does not generate rpm-related assets. If you find yourself in a situation where you need to generate highly-customized RPM assets, run the Omnibus generator command with the `--rpm-assets` flag:
34
+ Because of the unlikelihood of their necessity, Omnibus does not generate rpm-related assets. If you find yourself in a situation where you need to generate highly-customized RPM assets, run the Omnibus new command with the `--rpm-assets` flag:
35
35
 
36
- $ omnibus generate NAME --rpm-assets
36
+ $ omnibus new NAME --rpm-assets
37
37
 
38
38
  **If this is an existing project, be sure to answer "NO" when asked if you want to overwrite existing files!**
39
39
 
@@ -8,9 +8,9 @@ Building an .msi
8
8
  In Windows, an `.msi` is a special executable that contains the set of instructions for installating a piece of software on a target system. Please note, Omnibus does not support the creation of `.exe` files.
9
9
 
10
10
  ### Requirements
11
- By default, Omnibus does not generate msi-related assets. To generate the msi assets, run the Omnibus generator command with the `--msi-assets` flag:
11
+ By default, Omnibus does not generate msi-related assets. To generate the msi assets, run the Omnibus new command with the `--msi-assets` flag:
12
12
 
13
- $ omnibus generate NAME --msi-assets
13
+ $ omnibus new NAME --msi-assets
14
14
 
15
15
  **If this is an existing project, be sure to answer "NO" when asked if you want to overwrite existing files!**
16
16
 
@@ -293,6 +293,19 @@ module Omnibus
293
293
  # @!endgroup
294
294
  #
295
295
 
296
+ #
297
+ # @!group Publisher
298
+ # --------------------------------------------------
299
+
300
+ # The number of times to try to publish an artifact
301
+ #
302
+ # @return [Integer]
303
+ default(:publish_retries, 2)
304
+
305
+ # --------------------------------------------------
306
+ # @!endgroup
307
+ #
308
+
296
309
  #
297
310
  # @!group Artifactory Publisher
298
311
  # --------------------------------------------------
@@ -55,4 +55,17 @@ module OpenURI
55
55
  end
56
56
  end
57
57
  end
58
+
59
+ #
60
+ # Force Kernel#open to always return a Tempfile. This works around the fact
61
+ # that the OpenURI-provided Kernel#open returns a StringIO OR a Tempfile
62
+ # instances depending on the size of the data being downloaded. In the case
63
+ # of Omnibus we always want a Tempfile.
64
+ #
65
+ # @see http://winstonyw.com/2013/10/02/openuris_open_tempfile_and_stringio/
66
+ #
67
+ class Buffer
68
+ remove_const :StringMax
69
+ StringMax = 0
70
+ end
58
71
  end
@@ -214,7 +214,7 @@ module Omnibus
214
214
  converted = project.package_name.downcase.gsub(/[^a-z0-9\.\+\-]+/, '-')
215
215
 
216
216
  log.warn(log_key) do
217
- "The `name' compontent of BFF package names can only include " \
217
+ "The `name' component of BFF package names can only include " \
218
218
  "lowercase alphabetical characters (a-z), numbers (0-9), dots (.), " \
219
219
  "plus signs (+), and dashes (-). Converting `#{project.package_name}' to " \
220
220
  "`#{converted}'."
@@ -323,14 +323,14 @@ module Omnibus
323
323
  # @return [String]
324
324
  #
325
325
  def safe_base_package_name
326
- if project.package_name =~ /\A[a-zA-Z0-9\.\+\-]+\z/
326
+ if project.package_name =~ /\A[a-z0-9\.\+\-]+\z/
327
327
  project.package_name.dup
328
328
  else
329
- converted = project.package_name.gsub(/[^a-zA-Z0-9\.\+\-]+/, '-')
329
+ converted = project.package_name.downcase.gsub(/[^a-z0-9\.\+\-]+/, '-')
330
330
 
331
331
  log.warn(log_key) do
332
- "The `name' compontent of Debian package names can only include " \
333
- "alphabetical characters (a-z, A-Z), numbers (0-9), dots (.), " \
332
+ "The `name' component of Debian package names can only include " \
333
+ "lower case alphabetical characters (a-z), numbers (0-9), dots (.), " \
334
334
  "plus signs (+), and dashes (-). Converting `#{project.package_name}' to " \
335
335
  "`#{converted}'."
336
336
  end
@@ -340,7 +340,7 @@ module Omnibus
340
340
  end
341
341
 
342
342
  #
343
- # This is actually just the regular build_iternation, but it felt lonely
343
+ # This is actually just the regular build_iteration, but it felt lonely
344
344
  # among all the other +safe_*+ methods.
345
345
  #
346
346
  # @return [String]
@@ -350,21 +350,38 @@ module Omnibus
350
350
  end
351
351
 
352
352
  #
353
- # Return the Debian-ready version, converting any invalid characters to
354
- # dashes (+-+).
353
+ # Return the Debian-ready version, replacing all dashes (+-+) with tildes
354
+ # (+~+) and converting any invalid characters to underscores (+_+).
355
355
  #
356
356
  # @return [String]
357
357
  #
358
358
  def safe_version
359
- if project.build_version =~ /\A[a-zA-Z0-9\.\+\-\:]+\z/
360
- project.build_version.dup
359
+ version = project.build_version.dup
360
+
361
+ if version =~ /\-/
362
+ converted = version.gsub('-', '~')
363
+
364
+ log.warn(log_key) do
365
+ "Dashes hold special significance in the Debian package versions. " \
366
+ "Versions that contain a dash and should be considered an earlier " \
367
+ "version (e.g. pre-releases) may actually be ordered as later " \
368
+ "(e.g. 12.0.0-rc.6 > 12.0.0). We'll work around this by replacing " \
369
+ "dashes (-) with tildes (~). Converting `#{project.build_version}' " \
370
+ "to `#{converted}'."
371
+ end
372
+
373
+ version = converted
374
+ end
375
+
376
+ if version =~ /\A[a-zA-Z0-9\.\+\:\~]+\z/
377
+ version
361
378
  else
362
- converted = project.build_version.gsub(/[^a-zA-Z0-9\.\+\-\:]+/, '-')
379
+ converted = version.gsub(/[^a-zA-Z0-9\.\+\:\~]+/, '_')
363
380
 
364
381
  log.warn(log_key) do
365
- "The `version' compontent of Debian package names can only include " \
382
+ "The `version' component of Debian package names can only include " \
366
383
  "alphabetical characters (a-z, A-Z), numbers (0-9), dots (.), " \
367
- "plus signs (+), dashes (-), and colons (:). Converting " \
384
+ "plus signs (+), dashes (-), tildes (~) and colons (:). Converting " \
368
385
  "`#{project.build_version}' to `#{converted}'."
369
386
  end
370
387
 
@@ -268,7 +268,7 @@ module Omnibus
268
268
  converted = project.package_name.downcase.gsub(/[^[:alnum:]+]/, '')
269
269
 
270
270
  log.warn(log_key) do
271
- "The `name' compontent of Mac package names can only include " \
271
+ "The `name' component of Mac package names can only include " \
272
272
  "alphabetical characters (a-z, A-Z), and numbers (0-9). Converting " \
273
273
  "`#{project.package_name}' to `#{converted}'."
274
274
  end
@@ -314,7 +314,7 @@ module Omnibus
314
314
  converted = project.build_version.gsub(/[^a-zA-Z0-9\.\+\-]+/, '-')
315
315
 
316
316
  log.warn(log_key) do
317
- "The `version' compontent of Mac package names can only include " \
317
+ "The `version' component of Mac package names can only include " \
318
318
  "alphabetical characters (a-z, A-Z), numbers (0-9), dots (.), " \
319
319
  "plus signs (+), and dashes (-). Converting " \
320
320
  "`#{project.build_version}' to `#{converted}'."
@@ -240,6 +240,11 @@ module Omnibus
240
240
  hash
241
241
  end
242
242
 
243
+ # Exclude directories from the spec that are owned by the filesystem package:
244
+ # http://fedoraproject.org/wiki/Packaging:Guidelines#File_and_Directory_Ownership
245
+ filesystem_directories = IO.readlines(resource_path('filesystem_list'))
246
+ filesystem_directories.map! { |dirname| dirname.chomp }
247
+
243
248
  # Get a list of user-declared config files
244
249
  config_files = project.config_files.map { |file| rpm_safe(file) }
245
250
 
@@ -249,6 +254,7 @@ module Omnibus
249
254
  .map { |path| "/#{path}" }
250
255
  .map { |path| rpm_safe(path) }
251
256
  .reject { |path| config_files.include?(path) }
257
+ .reject { |path| filesystem_directories.include?(path) }
252
258
 
253
259
  render_template(resource_path('spec.erb'),
254
260
  destination: spec_file,
@@ -400,7 +406,7 @@ module Omnibus
400
406
  converted = project.package_name.downcase.gsub(/[^a-z0-9\.\+\-]+/, '-')
401
407
 
402
408
  log.warn(log_key) do
403
- "The `name' compontent of RPM package names can only include " \
409
+ "The `name' component of RPM package names can only include " \
404
410
  "lowercase alphabetical characters (a-z), numbers (0-9), dots (.), " \
405
411
  "plus signs (+), and dashes (-). Converting `#{project.package_name}' to " \
406
412
  "`#{converted}'."
@@ -427,15 +433,37 @@ module Omnibus
427
433
  # @return [String]
428
434
  #
429
435
  def safe_version
430
- if project.build_version =~ /\A[a-zA-Z0-9\.\+\_]+\z/
431
- project.build_version.dup
436
+ version = project.build_version.dup
437
+
438
+ # RPM 4.10+ added support for using the tilde (~) as a way to mark
439
+ # versions as lower priority in comparisons. More details on this
440
+ # feature can be found here:
441
+ #
442
+ # http://rpm.org/ticket/56
443
+ #
444
+ if version =~ /\-/
445
+ converted = version.gsub('-', '~')
446
+
447
+ log.warn(log_key) do
448
+ "Tildes hold special significance in the RPM package versions. " \
449
+ "They mark a version as lower priority in RPM's version compare " \
450
+ "logic. We'll replace all dashes (-) with tildes (~) so pre-release" \
451
+ "versions get sorted earlier then final versions. Converting" \
452
+ "`#{project.build_version}' to `#{converted}'."
453
+ end
454
+
455
+ version = converted
456
+ end
457
+
458
+ if version =~ /\A[a-zA-Z0-9\.\+\~]+\z/
459
+ version
432
460
  else
433
- converted = project.build_version.gsub('-', '_')
461
+ converted = version.gsub(/[^a-zA-Z0-9\.\+\~]+/, '_')
434
462
 
435
463
  log.warn(log_key) do
436
464
  "The `version' component of RPM package names can only include " \
437
465
  "alphabetical characters (a-z, A-Z), numbers (0-9), dots (.), " \
438
- "plus signs (+), and underscores (_). Converting " \
466
+ "plus signs (+), tildes (~) and underscores (_). Converting " \
439
467
  "`#{project.build_version}' to `#{converted}'."
440
468
  end
441
469
 
@@ -481,9 +481,9 @@ module Omnibus
481
481
  #
482
482
  def override(name, val = NULL)
483
483
  if null?(val)
484
- overrides[name]
484
+ overrides[name.to_sym]
485
485
  else
486
- overrides[name] = val
486
+ overrides[name.to_sym] = val
487
487
  end
488
488
  end
489
489
  expose :override
@@ -15,6 +15,7 @@
15
15
  #
16
16
 
17
17
  require 'uri'
18
+ require 'benchmark'
18
19
 
19
20
  module Omnibus
20
21
  class ArtifactoryPublisher < Publisher
@@ -29,11 +30,28 @@ module Omnibus
29
30
 
30
31
  # Upload the actual package
31
32
  log.info(log_key) { "Uploading '#{package.name}'" }
32
- artifact_for(package).upload(
33
- repository,
34
- remote_path_for(package),
35
- metadata_for(package),
36
- )
33
+
34
+ retries = Config.publish_retries
35
+
36
+ begin
37
+ upload_time = Benchmark.realtime do
38
+ artifact_for(package).upload(
39
+ repository,
40
+ remote_path_for(package),
41
+ metadata_for(package),
42
+ )
43
+ end
44
+ rescue Artifactory::Error::HTTPError => e
45
+ if (retries -= 1) != 0
46
+ log.info(log_key) { "Upload failed with exception: #{e}"}
47
+ log.info(log_key) { "Retrying failed publish #{retries} more time(s)..." }
48
+ retry
49
+ else
50
+ raise e
51
+ end
52
+ end
53
+
54
+ log.debug(log_key) { "Elapsed time to publish #{package.name}: #{1000*upload_time} ms" }
37
55
 
38
56
  # If a block was given, "yield" the package to the caller
39
57
  block.call(package) if block