packaging 0.99.20 → 0.99.21

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
  SHA256:
3
- metadata.gz: 804655457090e137a8f4566d13c77e4d4e792666939db68d790eb88d7ed63a9a
4
- data.tar.gz: 0140bb84f7b2913dd0b20a8c73bf4f0ad62b6f6c133cb75d3cda1fd5dbbb52be
3
+ metadata.gz: 0f27625bd6bdb946ecb72f13d077107c99f8deed39fb1476f050f9cc0f6a36be
4
+ data.tar.gz: 98e16357d4462b0d3922bb324e19693266539fe4bd30c9c49822b34f7a1a0416
5
5
  SHA512:
6
- metadata.gz: fd0c5cb26659c58f2ed3bad60ab46a2d1f4445cc59059994a3b41de175625ba5a97b11bd5e7fd09bb4a30bdf71667ed8570eb00d6fb03754444604f9098055da
7
- data.tar.gz: da1e8c55b4efeb18bb9cef07fe0a540eecbfa34921ae56da0c04cb45c2868b8a84dd23b29437f424e7f9a8b2ca5cf557c770b4bbb64e9308ad7d44a914788207
6
+ metadata.gz: d80e4dec3981814422e2f5209ed2441c219425317514ba73bb2df41eefb5da4304188dd38220708aa1aeebdb3bda5ae9b5f379b4bd1b550109eb82cbee63ac21
7
+ data.tar.gz: 4ef4ffa39932705e464cfa88a2c0fd3537386f082fa4a74adf1d145ccfecbb0b3be501935dd65af8a7423555cbdc47c7127f752f18c956cae7667136d0a48052
@@ -293,7 +293,7 @@ module Pkg::Util::Net
293
293
  # @option :excludes [Array] Strings you want to exclude from your search,
294
294
  # e.g. 'agent' if only searching for 'puppet'.
295
295
  def remote_create_latest_symlink(package_name, dir, platform_ext, options = {})
296
- ls_cmd = "ls -1 *.#{platform_ext} | grep -v latest | grep -v rc | grep #{package_name} "
296
+ ls_cmd = "ls -1 *.#{platform_ext} | grep -v latest | grep -v rc | grep -P #{package_name}-\d "
297
297
 
298
298
  # store this in a separate var to avoid side affects
299
299
  full_package_name = String.new(package_name)
@@ -70,7 +70,7 @@ module Pkg::Util::Ship
70
70
  # First find the packages to be shipped. We must find them before moving
71
71
  # to our temporary staging directory
72
72
  local_packages = collect_packages(pkg_exts, options[:excludes])
73
- return if local_packages.empty?
73
+ return false if local_packages.empty?
74
74
 
75
75
  tmpdir = Dir.mktmpdir
76
76
  staged_pkgs = reorganize_packages(local_packages, tmpdir, options[:platform_independent], options[:nonfinal])
@@ -100,6 +100,7 @@ module Pkg::Util::Ship
100
100
  Pkg::Util::Net.remote_set_immutable(staging_server, [remote_pkg]) if options[:chattr]
101
101
  end
102
102
  end
103
+ return true
103
104
  end
104
105
  end
105
106
 
@@ -132,13 +133,15 @@ module Pkg::Util::Ship
132
133
  end
133
134
 
134
135
  def ship_dmg(local_staging_directory, remote_path, opts = {})
135
- ship_pkgs(["#{local_staging_directory}/**/*.dmg"], Pkg::Config.dmg_staging_server, remote_path, opts)
136
+ packages_have_shipped = ship_pkgs(["#{local_staging_directory}/**/*.dmg"], Pkg::Config.dmg_staging_server, remote_path, opts)
136
137
 
137
138
  create_rolling_repo_link(Pkg::Platforms.generic_platform_tag('osx'), Pkg::Config.dmg_staging_server, remote_path, opts[:nonfinal])
138
139
 
139
- Pkg::Platforms.platform_tags_for_package_format('dmg').each do |platform_tag|
140
- # Create the latest symlink for the current supported repo
141
- Pkg::Util::Net.remote_create_latest_symlink(Pkg::Config.project, Pkg::Paths.artifacts_path(platform_tag, remote_path), 'dmg')
140
+ if packages_have_shipped
141
+ Pkg::Platforms.platform_tags_for_package_format('dmg').each do |platform_tag|
142
+ # Create the latest symlink for the current supported repo
143
+ Pkg::Util::Net.remote_create_latest_symlink(Pkg::Config.project, Pkg::Paths.artifacts_path(platform_tag, remote_path), 'dmg')
144
+ end
142
145
  end
143
146
  end
144
147
 
@@ -149,12 +152,14 @@ module Pkg::Util::Ship
149
152
  end
150
153
 
151
154
  def ship_msi(local_staging_directory, remote_path, opts = {})
152
- ship_pkgs(["#{local_staging_directory}/**/*.msi"], Pkg::Config.msi_staging_server, remote_path, opts)
155
+ packages_have_shipped = ship_pkgs(["#{local_staging_directory}/**/*.msi"], Pkg::Config.msi_staging_server, remote_path, opts)
153
156
 
154
157
  create_rolling_repo_link(Pkg::Platforms.generic_platform_tag('windows'), Pkg::Config.msi_staging_server, remote_path, opts[:nonfinal])
155
- # Create the symlinks for the latest supported repo
156
- Pkg::Util::Net.remote_create_latest_symlink(Pkg::Config.project, Pkg::Paths.artifacts_path(Pkg::Platforms.generic_platform_tag('windows'), remote_path), 'msi', arch: 'x64')
157
- Pkg::Util::Net.remote_create_latest_symlink(Pkg::Config.project, Pkg::Paths.artifacts_path(Pkg::Platforms.generic_platform_tag('windows'), remote_path), 'msi', arch: 'x86')
158
+ if packages_have_shipped
159
+ # Create the symlinks for the latest supported repo
160
+ Pkg::Util::Net.remote_create_latest_symlink(Pkg::Config.project, Pkg::Paths.artifacts_path(Pkg::Platforms.generic_platform_tag('windows'), remote_path), 'msi', arch: 'x64')
161
+ Pkg::Util::Net.remote_create_latest_symlink(Pkg::Config.project, Pkg::Paths.artifacts_path(Pkg::Platforms.generic_platform_tag('windows'), remote_path), 'msi', arch: 'x86')
162
+ end
158
163
  end
159
164
 
160
165
  def ship_gem(local_staging_directory, remote_path, opts = {})
@@ -95,7 +95,7 @@ new_pkgs = [
95
95
  expect(Pkg::Util::Net).to receive(:remote_set_permissions).with(test_staging_server, '775', anything).exactly(local_pkgs.count).times
96
96
  expect(Pkg::Util::Net).to receive(:remote_set_permissions).with(test_staging_server, '0664', anything).exactly(local_pkgs.count).times
97
97
  expect(Pkg::Util::Net).to receive(:remote_set_immutable).with(test_staging_server, anything).exactly(local_pkgs.count).times
98
- Pkg::Util::Ship.ship_pkgs(['pkg/**/*.rpm'], test_staging_server, test_remote_path)
98
+ expect(Pkg::Util::Ship.ship_pkgs(['pkg/**/*.rpm'], test_staging_server, test_remote_path)).to eq(true)
99
99
  end
100
100
 
101
101
  it 'ships packages containing the string `pkg` to the right place' do
@@ -111,7 +111,11 @@ new_pkgs = [
111
111
  expect(Pkg::Util::Net).to receive(:remote_set_permissions).with(test_staging_server, '775', anything)
112
112
  expect(Pkg::Util::Net).to receive(:remote_set_permissions).with(test_staging_server, '0664', anything)
113
113
  expect(Pkg::Util::Net).to receive(:remote_set_immutable).with(test_staging_server, anything)
114
- Pkg::Util::Ship.ship_pkgs(['pkg/**/*.rpm'], test_staging_server, test_remote_path, excludes: ['puppet-agent'])
114
+ expect(Pkg::Util::Ship.ship_pkgs(['pkg/**/*.rpm'], test_staging_server, test_remote_path, excludes: ['puppet-agent'])).to eq(true)
115
+ end
116
+
117
+ it 'returns false if there are no packages to ship' do
118
+ expect(Pkg::Util::Ship.ship_pkgs(['pkg/**/*.msi'], test_staging_server, test_remote_path)).to eq(false)
115
119
  end
116
120
  end
117
121
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: packaging
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.99.20
4
+ version: 0.99.21
5
5
  platform: ruby
6
6
  authors:
7
7
  - Puppet Labs
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2018-12-17 00:00:00.000000000 Z
11
+ date: 2019-01-08 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rspec
@@ -228,27 +228,27 @@ signing_key:
228
228
  specification_version: 4
229
229
  summary: Puppet Labs' packaging automation
230
230
  test_files:
231
+ - spec/lib/packaging/artifactory_spec.rb
232
+ - spec/lib/packaging/config_spec.rb
233
+ - spec/lib/packaging/deb/repo_spec.rb
234
+ - spec/lib/packaging/deb_spec.rb
231
235
  - spec/lib/packaging/paths_spec.rb
236
+ - spec/lib/packaging/platforms_spec.rb
237
+ - spec/lib/packaging/repo_spec.rb
238
+ - spec/lib/packaging/retrieve_spec.rb
239
+ - spec/lib/packaging/rpm/repo_spec.rb
232
240
  - spec/lib/packaging/sign_spec.rb
233
- - spec/lib/packaging/config_spec.rb
241
+ - spec/lib/packaging/tar_spec.rb
234
242
  - spec/lib/packaging/util/execution_spec.rb
235
- - spec/lib/packaging/util/os_spec.rb
236
- - spec/lib/packaging/util/version_spec.rb
243
+ - spec/lib/packaging/util/file_spec.rb
237
244
  - spec/lib/packaging/util/git_spec.rb
238
- - spec/lib/packaging/util/jenkins_spec.rb
239
- - spec/lib/packaging/util/rake_utils_spec.rb
240
- - spec/lib/packaging/util/gpg_spec.rb
241
245
  - spec/lib/packaging/util/git_tag_spec.rb
242
- - spec/lib/packaging/util/file_spec.rb
243
- - spec/lib/packaging/util/net_spec.rb
246
+ - spec/lib/packaging/util/gpg_spec.rb
247
+ - spec/lib/packaging/util/jenkins_spec.rb
244
248
  - spec/lib/packaging/util/misc_spec.rb
249
+ - spec/lib/packaging/util/net_spec.rb
250
+ - spec/lib/packaging/util/os_spec.rb
251
+ - spec/lib/packaging/util/rake_utils_spec.rb
245
252
  - spec/lib/packaging/util/ship_spec.rb
246
- - spec/lib/packaging/repo_spec.rb
247
- - spec/lib/packaging/tar_spec.rb
248
- - spec/lib/packaging/retrieve_spec.rb
249
- - spec/lib/packaging/platforms_spec.rb
250
- - spec/lib/packaging/deb_spec.rb
251
- - spec/lib/packaging/deb/repo_spec.rb
252
- - spec/lib/packaging/rpm/repo_spec.rb
253
- - spec/lib/packaging/artifactory_spec.rb
253
+ - spec/lib/packaging/util/version_spec.rb
254
254
  - spec/lib/packaging_spec.rb