packaging 0.99.29 → 0.99.30

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: 9f423cc0b3db951ead3f977e29ce01bb1ef130b86ce40de7b21c45f8c7cb7952
4
- data.tar.gz: e15f8d7c8bb1f03dea062857bc5e8669e175b11d11855affa24e653fa45b87f1
3
+ metadata.gz: 7cfddfe342677b102df76026925a4f2d6c63d3ab462f11c663f370a66a54bcc0
4
+ data.tar.gz: 7b4b4bf61cd61f5b131ece5020bf6cb99ef6551118ddaeec5884036718c41078
5
5
  SHA512:
6
- metadata.gz: 40aa070d4b58734c6b16be7ceac959b860560016f407dfb124349cb51e5afd6d6cbe1f506c3aaecbce345e029ca861527d2d419167235114083b9555ec466f0c
7
- data.tar.gz: aa7e8edc975af46c0b08370e94e2335381bdba55cc281f908e207b6b80db1c60a79f6319c88782500b8a2e5b24865a6aa90362be4e9a3fb36f4167053cf15382
6
+ metadata.gz: 779471e6fc2b8b379ac5a1e30c8f0d4002406b2ef267c8ff3fdd7384a97d61e29a9616b77b03851fd65ece2c95007a079b933eeeb0465d89e82260ca4cfb959d
7
+ data.tar.gz: 83d313b8e9342138e946e0d652c3b88880a7f16c7d2eda18f54bfb3cd793102201cd787be0f39eb0981757dd79bd63707f41b6ce36733d831f80f511c526dc9d
@@ -266,10 +266,12 @@ module Pkg
266
266
  # @param ref [String] tag or SHA of package(s) to be promoted
267
267
  # @param platform_tag [String] the platform tag of the artifact
268
268
  # ex. el-7-x86_64, ubuntu-18.04-amd64
269
- # @param repositories [Array(String)] the repositories to promote
269
+ # @param repository [String] the repository to promote
270
270
  # the artifact to. Will prepend 'rpm_' or 'debian_' to the repositories
271
271
  # depending on package type
272
- def promote_package(pkg, ref, platform_tag, repositories)
272
+ # @param debian_component [String] the debian component to promote packages
273
+ # into. Optional.
274
+ def promote_package(pkg, ref, platform_tag, repository, debian_component = nil)
273
275
  # load package metadata
274
276
  yaml_content = retrieve_yaml_data(pkg, ref)
275
277
  yaml_data = YAML::load(yaml_content)
@@ -286,17 +288,21 @@ module Pkg
286
288
  # This makes an assumption that we're using some consistent repo names
287
289
  # but need to either prepend 'rpm_' or 'debian_' based on package type
288
290
  if File.extname(artifact_name) == '.rpm'
289
- promotion_paths = Array(repositories).compact.map { |repo| "rpm_#{repo}/#{platform_tag}/#{artifact_name}" }
291
+ promotion_path = "rpm_#{repository}/#{platform_tag}/#{artifact_name}"
290
292
  elsif File.extname(artifact_name) == '.deb'
291
- promotion_paths = Array(repositories).compact.map { |repo| "debian_#{repo}/#{platform_tag}/#{artifact_name}" }
293
+ promotion_path = "debian_#{repository}/#{platform_tag}/#{artifact_name}"
294
+ properties = { 'deb.component' => debian_component } unless debian_component.nil?
292
295
  else
293
296
  raise "Error: Unknown promotion repository for #{artifact_name}! Only .rpm and .deb files are supported!"
294
297
  end
295
298
 
296
299
  begin
297
- promotion_paths.each do |path|
298
- puts "promoting #{artifact_name} to #{path}"
299
- artifact_to_promote[0].copy(path)
300
+ puts "promoting #{artifact_name} to #{promotion_path}"
301
+ artifact_to_promote[0].copy(promotion_path)
302
+ unless properties.nil?
303
+ artifacts = Artifactory::Resource::Artifact.search(name: artifact_name, :artifactory_uri => @artifactory_uri)
304
+ promoted_artifact = artifacts.select { |artifact| artifact.download_uri =~ %r{#{promotion_path}} }.first
305
+ promoted_artifact.properties(properties)
300
306
  end
301
307
  rescue Artifactory::Error::HTTPError => e
302
308
  if e.message =~ /destination and source are the same/i
@@ -140,7 +140,7 @@ module Pkg::Util::Ship
140
140
  if packages_have_shipped
141
141
  Pkg::Platforms.platform_tags_for_package_format('dmg').each do |platform_tag|
142
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')
143
+ Pkg::Util::Net.remote_create_latest_symlink(Pkg::Config.project, Pkg::Paths.artifacts_path(platform_tag, remote_path, opts[:nonfinal]), 'dmg')
144
144
  end
145
145
  end
146
146
  end
@@ -157,8 +157,8 @@ module Pkg::Util::Ship
157
157
  create_rolling_repo_link(Pkg::Platforms.generic_platform_tag('windows'), Pkg::Config.msi_staging_server, remote_path, opts[:nonfinal])
158
158
  if packages_have_shipped
159
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')
160
+ Pkg::Util::Net.remote_create_latest_symlink(Pkg::Config.project, Pkg::Paths.artifacts_path(Pkg::Platforms.generic_platform_tag('windows'), remote_path, opts[:nonfinal]), '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, opts[:nonfinal]), 'msi', arch: 'x86')
162
162
  end
163
163
  end
164
164
 
@@ -1 +1 @@
1
- ../params.yaml
1
+ spec/fixtures/config/ext/../params.yaml
@@ -1 +1 @@
1
- ../params.yaml
1
+ spec/fixtures/config/ext/../params.yaml
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.29
4
+ version: 0.99.30
5
5
  platform: ruby
6
6
  authors:
7
7
  - Puppet Labs
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2019-04-18 00:00:00.000000000 Z
11
+ date: 2019-04-25 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rspec
@@ -223,7 +223,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
223
223
  - !ruby/object:Gem::Version
224
224
  version: '0'
225
225
  requirements: []
226
- rubygems_version: 3.0.3
226
+ rubyforge_project:
227
+ rubygems_version: 2.7.6
227
228
  signing_key:
228
229
  specification_version: 4
229
230
  summary: Puppet Labs' packaging automation