packaging 0.99.4 → 0.99.5

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: 517f281100a098c92bfdb3b38b538d015d215537
4
- data.tar.gz: dabf433d9fc8641f5619a108ccb7de3b574d9961
3
+ metadata.gz: 88e28e28af482a06291f1f585ede34b6426cb3d3
4
+ data.tar.gz: 14a563722d00b01bf7237c6395193195f71e8206
5
5
  SHA512:
6
- metadata.gz: ac5527ee23314f1103309ffe888fa747aa1389c593cdaf4a9624b3ef3089155cd02222b54cf338f26e96ac19c9c011dc67ed837e2352384817d4f805224bfcc6
7
- data.tar.gz: bd52d91b00509f4e2feab65e1ff2ce33f6a61843442982066306a3701f03d668f440ea380b0461d537c4205f4fc65579a55b1e60a520d9d58be9f486afd9c2c7
6
+ metadata.gz: a667b0640aa6361ddb3b7343404102c8461d290ed4f2651fe1b489b85d04a3dc0f5a4d75fa36f6aa186f8cd3191c8d1fdfe306a05d3219e977e40ad3505087f7
7
+ data.tar.gz: 1fd1370fc99e8bafc3881847bd2f909aa6a1d4f8971c654393f62484bf45b2970dec5ec6e0668bdafb8debb37858efe2f812208c409c6252ac57b7836b00482e
@@ -76,8 +76,6 @@ module Pkg::Params
76
76
  :gpg_name,
77
77
  :homepage,
78
78
  :internal_gem_host,
79
- :internal_nexus_host,
80
- :internal_stickler_host,
81
79
  :ips_build_host,
82
80
  :ips_host,
83
81
  :ips_inter_cert,
@@ -268,6 +266,7 @@ module Pkg::Params
268
266
  { :var => :pe_feature_branch, :envvar => :PE_FEATURE_BRANCH },
269
267
  { :var => :pe_version, :envvar => :PE_VER },
270
268
  { :var => :privatekey_pem, :envvar => :PRIVATE_PEM },
269
+ { :var => :project, :envvar => :PROJECT_OVERRIDE },
271
270
  { :var => :project_root, :envvar => :PROJECT_ROOT },
272
271
  { :var => :random_mockroot, :envvar => :RANDOM_MOCKROOT, :type => :bool },
273
272
  { :var => :rc_mocks, :envvar => :MOCK },
@@ -292,8 +291,6 @@ module Pkg::Params
292
291
  { :var => :yum_repo_path, :envvar => :YUM_REPO },
293
292
  { :var => :yum_staging_server, :envvar => :YUM_STAGING_SERVER },
294
293
  { :var => :internal_gem_host, :envvar => :INTERNAL_GEM_HOST },
295
- { :var => :internal_nexus_host, :envvar => :INTERNAL_NEXUS_HOST },
296
- { :var => :internal_stickler_host, :envvar => :INTERNAL_STICKLER_HOST },
297
294
  ]
298
295
  # Default values that are supplied if the user does not supply them
299
296
  #
@@ -332,8 +329,6 @@ module Pkg::Params
332
329
  # in case it is not set.
333
330
  #
334
331
  REASSIGNMENTS = [
335
- { :oldvar => :internal_gem_host, :newvar => :internal_nexus_host },
336
- { :oldvar => :internal_gem_host, :newvar => :internal_stickler_host },
337
332
  # These are fall-through values for shipping endpoints
338
333
  { :oldvar => :staging_server, :newvar => :apt_staging_server },
339
334
  { :oldvar => :staging_server, :newvar => :dmg_staging_server },
data/lib/packaging/gem.rb CHANGED
@@ -1,91 +1,13 @@
1
1
  module Pkg::Gem
2
- @nexus_config = "#{ENV['HOME']}/.gem/nexus"
3
-
4
2
  class << self
5
3
  # This is preserved because I don't want to update the deprecated code path
6
4
  # yet; I'm not entirely sure I've fixed everything that might attempt
7
5
  # to call this method so this is now a wrapper for a wrapper.
8
6
  def ship(file)
9
- ship_to_stickler(file)
10
- ship_to_nexus(file)
11
7
  rsync_to_downloads(file)
12
8
  ship_to_rubygems(file)
13
9
  end
14
10
 
15
- def load_nexus_config
16
- if Pkg::Util::File.file_exists?(@nexus_config)
17
- config = YAML.load_file(@nexus_config)
18
- end
19
- config || {}
20
- end
21
-
22
- def write_nexus_config
23
- hash = load_nexus_config
24
- if hash["GEM_INTERNAL"].nil? || hash["GEM_INTERNAL"][:authorization].nil?
25
- puts "Please enter nexus username:"
26
- username = Pkg::Util.get_input
27
- puts "Please enter nexus password:"
28
- password = Pkg::Util.get_input(false)
29
- hash["GEM_INTERNAL"] = { :authorization => "Basic #{Pkg::Util.base64_encode("#{username}:#{password}")}" }
30
- end
31
- if hash["GEM_INTERNAL"][:url].nil? || hash["GEM_INTERNAL"][:url] != Pkg::Config.internal_nexus_host
32
- hash["GEM_INTERNAL"][:url] = Pkg::Config.internal_nexus_host
33
- end
34
- File.open(@nexus_config, "w") do |file|
35
- file.write(hash.to_yaml)
36
- end
37
- end
38
-
39
- # Ship a Ruby gem file to a Nexus server, because
40
- # you've lost the ability to feel joy anymore.
41
- def ship_to_nexus(file)
42
- write_nexus_config
43
- cmd = "gem nexus #{file} --repo GEM_INTERNAL"
44
- if ENV['DRYRUN']
45
- puts "[DRY-RUN] #{cmd}"
46
- else
47
- stdout, _, _ = Pkg::Util::Execution.capture3(cmd, true)
48
- # The `gem nexus` command always returns `0` regardless of what the
49
- # command results in. In order to properly handle fail cases, this
50
- # checks for the success case and fails otherwise. The `ex` command
51
- # above will print any output, so the user should have enough info
52
- # to debug the failure, and potentially update this fail case if
53
- # needed.
54
- fail unless stdout.include? "Created"
55
- puts "#{file} pushed to nexus server at #{Pkg::Config.internal_nexus_host}"
56
- end
57
- rescue => e
58
- puts "###########################################"
59
- puts "# Nexus failed, ensure the nexus gem is installed,"
60
- puts "# you have access to #{Pkg::Config.internal_nexus_host}"
61
- puts "# and your settings in #{@nexus_config} are correct"
62
- puts "###########################################"
63
- puts
64
- puts e
65
- raise e
66
- end
67
-
68
- # Ship a Ruby gem file to a Stickler server, because
69
- # you've lost the ability to feel joy anymore.
70
- def ship_to_stickler(file)
71
- Pkg::Util::Tool.check_tool("stickler")
72
- cmd = "stickler push #{file} --server=#{Pkg::Config.internal_stickler_host} 2>/dev/null"
73
- if ENV['DRYRUN']
74
- puts "[DRY-RUN] #{cmd}"
75
- else
76
- Pkg::Util::Execution.capture3(cmd)
77
- puts "#{file} pushed to stickler server at #{Pkg::Config.internal_stickler_host}"
78
- end
79
- rescue => e
80
- puts "###########################################"
81
- puts "# Stickler failed, ensure it's installed"
82
- puts "# and you have access to #{Pkg::Config.internal_stickler_host}"
83
- puts "###########################################"
84
- puts
85
- puts e
86
- raise e
87
- end
88
-
89
11
  # Use rsync to deploy a file and any associated detached signatures,
90
12
  # checksums, or other glob-able artifacts to an external download server.
91
13
  def rsync_to_downloads(file)
@@ -2,7 +2,7 @@ module Pkg::Nuget
2
2
  class << self
3
3
  def ship(packages)
4
4
  #
5
- # Support shipping of Nuget style packages to a nexus based nuget feed
5
+ # Support shipping of Nuget style packages to an Artifactory based nuget feed
6
6
  # Using curl to submit the packages rather than windows based choco/mono.
7
7
  # This approach gives more flexibility and fits in with the current Puppet
8
8
  # release automation practices using linux/mac systems.
@@ -55,7 +55,8 @@ module Pkg::Retrieve
55
55
  end
56
56
  platform_data = Pkg::Util::Serialization.load_yaml(yaml_path)[:platform_data]
57
57
  platform_data.each do |platform, paths|
58
- default_wget(local_target, "#{build_url}/#{paths[:artifact]}") if Pkg::Config.foss_platforms.include?(platform)
58
+ path_to_retrieve = File.dirname(paths[:artifact])
59
+ default_wget(local_target, "#{build_url}/#{path_to_retrieve}/") if Pkg::Config.foss_platforms.include?(platform)
59
60
  end
60
61
  end
61
62
 
@@ -0,0 +1,2 @@
1
+ ---
2
+ :apt_host: foo
@@ -0,0 +1,2 @@
1
+ ---
2
+ :apt_host: foo
data/tasks/jenkins.rake CHANGED
@@ -257,6 +257,7 @@ namespace :pl do
257
257
  ship_debs
258
258
  ship_dmg
259
259
  ship_swix
260
+ ship_tar
260
261
  ship_msi
261
262
  )
262
263
  tasks.map { |t| "pl:#{t}" }.each do |t|
data/tasks/pe_ship.rake CHANGED
@@ -14,9 +14,9 @@ if Pkg::Config.build_pe
14
14
  end
15
15
  if Pkg::Config.team == 'release'
16
16
 
17
- # If this is not a feature branch, we need to link the shipped packages into the feature repos,
18
- # then update their metadata as well.
19
- unless Pkg::Config.pe_feature_branch
17
+ # If this is not a feature branch or release branch, we need to link the
18
+ # shipped packages into the feature repos and update their metadata.
19
+ unless Pkg::Config.pe_feature_branch || Pkg::Config.pe_release_branch
20
20
  puts "Linking RPMs to feature repo"
21
21
  Pkg::Util::RakeUtils.invoke_task("pe:remote:link_shipped_rpms_to_feature_repo")
22
22
  Pkg::Util::RakeUtils.invoke_task("pe:remote:update_yum_repo")
@@ -126,8 +126,9 @@ if Pkg::Config.build_pe
126
126
  files += Dir["pkg/pe/deb/#{dist}/*"].select { |f| f !~ /^.*\.deb$/ }.map { |f| "#{base_path}/#{dist}-source/#{File.basename(f)}" }
127
127
  end
128
128
  end
129
- # If this is not a feature branch, we need to link the shipped packages into the feature repos
130
- unless Pkg::Config.pe_feature_branch
129
+ # If this is not a feature branch or release branch, we need to link the
130
+ # shipped packages into the feature repos
131
+ unless Pkg::Config.pe_feature_branch || Pkg::Config.pe_release_branch
131
132
  puts "Linking DEBs to feature repo"
132
133
  Pkg::Util::RakeUtils.invoke_task("pe:remote:link_shipped_debs_to_feature_repo")
133
134
  end
data/tasks/retrieve.rake CHANGED
@@ -14,6 +14,9 @@ namespace :pl do
14
14
  namespace :jenkins do
15
15
  desc "Retrieve packages from the distribution server\. Check out commit to retrieve"
16
16
  task :retrieve, [:remote_target, :local_target] => 'pl:fetch' do |t, args|
17
+ unless Pkg::Config.project
18
+ fail "You must set the 'project' in build_defaults.yaml or with the 'PROJECT' environment variable."
19
+ end
17
20
  remote_target = args.remote_target || "artifacts"
18
21
  local_target = args.local_target || "pkg"
19
22
  mkdir_p local_target
@@ -35,6 +38,9 @@ if Pkg::Config.build_pe
35
38
  namespace :jenkins do
36
39
  desc "Retrieve packages from the distribution server\. Check out commit to retrieve"
37
40
  task :retrieve, [:remote_target, :local_target] => 'pl:fetch' do |t, args|
41
+ unless Pkg::Config.project
42
+ fail "You must set the 'project' in build_defaults.yaml or with the 'PROJECT' environment variable."
43
+ end
38
44
  remote_target = args.remote_target || "artifacts"
39
45
  local_target = args.local_target || "pkg"
40
46
  build_url = "http://#{Pkg::Config.builds_server}/#{Pkg::Config.project}/#{Pkg::Config.ref}/#{remote_target}"
data/tasks/ship.rake CHANGED
@@ -309,22 +309,6 @@ namespace :pl do
309
309
  unless Pkg::Config.internal_gem_host
310
310
  warn 'Value `Pkg::Config.internal_gem_host` not defined; skipping internal ship'
311
311
  end
312
-
313
- puts "Do you want to ship #{args[:file]} to the internal stickler server(#{Pkg::Config.internal_stickler_host})?"
314
- if Pkg::Util.ask_yes_or_no
315
- puts "Shipping gem #{args[:file]} to internal Gem server (#{Pkg::Config.internal_stickler_host})"
316
- Pkg::Util::Execution.retry_on_fail(times: 3) do
317
- Pkg::Gem.ship_to_stickler(args[:file])
318
- end
319
- end
320
-
321
- puts "Do you want to ship #{args[:file]} to the internal nexus server(#{Pkg::Config.internal_nexus_host})?"
322
- if Pkg::Util.ask_yes_or_no
323
- puts "Shipping gem #{args[:file]} to internal Gem server (#{Pkg::Config.internal_nexus_host})"
324
- Pkg::Util::Execution.retry_on_fail(times: 3) do
325
- Pkg::Gem.ship_to_nexus(args[:file])
326
- end
327
- end
328
312
  end
329
313
 
330
314
  desc "Ship built gems to public Downloads server (#{Pkg::Config.gem_host})"
@@ -511,22 +495,6 @@ namespace :pl do
511
495
  end
512
496
 
513
497
  if Pkg::Config.build_gem
514
- # Do we have stickler and nexus?
515
- if Pkg::Util::Misc.check_gem('stickler')
516
- `stickler list --server #{Pkg::Config.internal_stickler_host} > /dev/null 2>&1`
517
- unless $CHILD_STATUS.zero?
518
- errs << "Listing gems at the stickler server #{Pkg::Config.internal_stickler_host} failed!"
519
- end
520
- else
521
- errs << 'gem stickler not found'
522
- end
523
-
524
- errs << 'gem nexus not found' unless Pkg::Util::Misc.check_gem('nexus')
525
- `gem list --source #{Pkg::Config.internal_nexus_host} > /dev/null 2>&1`
526
- unless $CHILD_STATUS.zero?
527
- errs << "Listing gems at the nexus server #{Pkg::Config.internal_nexus_host} failed!"
528
- end
529
-
530
498
  # Do we have rubygems access set up
531
499
  if Pkg::Util::File.file_exists?("#{ENV['HOME']}/.gem/credentials")
532
500
  # Do we have permissions to publish this gem on rubygems
@@ -559,6 +527,9 @@ namespace :pl do
559
527
  desc 'ship pkg directory contents to artifactory'
560
528
  task :ship_to_artifactory, :local_dir do |_t, args|
561
529
  Pkg::Util::RakeUtils.invoke_task('pl:fetch')
530
+ unless Pkg::Config.project
531
+ fail "You must set the 'project' in build_defaults.yaml or with the 'PROJECT' environment variable."
532
+ end
562
533
  artifactory = Pkg::ManageArtifactory.new(Pkg::Config.project, Pkg::Config.ref)
563
534
 
564
535
  local_dir = args.local_dir || 'pkg'
@@ -570,6 +541,9 @@ namespace :pl do
570
541
  desc 'Ship pkg directory contents to distribution server'
571
542
  task :ship, :target, :local_dir do |_t, args|
572
543
  Pkg::Util::RakeUtils.invoke_task('pl:fetch')
544
+ unless Pkg::Config.project
545
+ fail "You must set the 'project' in build_defaults.yaml or with the 'PROJECT' environment variable."
546
+ end
573
547
  target = args.target || 'artifacts'
574
548
  local_dir = args.local_dir || 'pkg'
575
549
  project_basedir = "#{Pkg::Config.jenkins_repo_path}/#{Pkg::Config.project}/#{Pkg::Config.ref}"
data/tasks/sign.rake CHANGED
@@ -162,7 +162,7 @@ namespace :pl do
162
162
  end
163
163
 
164
164
  ##
165
- # This crazy piece of work establishes a remote repo on the distribution
165
+ # This crazy piece of work establishes a remote repo on the signing
166
166
  # server, ships our packages out to it, signs them, and brings them back.
167
167
  #
168
168
  namespace :jenkins do
@@ -212,4 +212,4 @@ DOC
212
212
  puts "Signed packages staged in #{$DEFAULT_DIRECTORY}/ directory"
213
213
  end
214
214
  end
215
- end
215
+ 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.4
4
+ version: 0.99.5
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-04-17 00:00:00.000000000 Z
11
+ date: 2018-05-09 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rspec
@@ -208,7 +208,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
208
208
  version: '0'
209
209
  requirements: []
210
210
  rubyforge_project:
211
- rubygems_version: 2.6.10
211
+ rubygems_version: 2.4.5.1
212
212
  signing_key:
213
213
  specification_version: 4
214
214
  summary: Puppet Labs' packaging automation
@@ -1 +0,0 @@
1
- spec/fixtures/config/ext/../params.yaml
@@ -1 +0,0 @@
1
- spec/fixtures/config/ext/../params.yaml