Skip to content

Commit

Permalink
Merge pull request #1254 from e-gris/RE-16160
Browse files Browse the repository at this point in the history
(RE-16160) Revive sign/ips.rb
  • Loading branch information
e-gris authored Apr 15, 2024
2 parents 89e84b9 + c554fcf commit d91c2d9
Show file tree
Hide file tree
Showing 5 changed files with 20 additions and 9 deletions.
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,9 @@
This changelog adheres to [Keep a CHANGELOG](http://keepachangelog.com/).

## [Unreleased]
### Changed
- (RE-16160) Revive sign/ips.rb so that GPG .asc generation for Solaris packages are handled
in a single method.

## [0.118.0] - 2024-04-05
### Added
Expand Down
1 change: 1 addition & 0 deletions lib/packaging/sign.rb
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
module Pkg::Sign
require 'packaging/sign/deb'
require 'packaging/sign/dmg'
require 'packaging/sign/ips'
require 'packaging/sign/msi'
require 'packaging/sign/rpm'
end
13 changes: 13 additions & 0 deletions lib/packaging/sign/ips.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
module Pkg::Sign::Ips
module_function

def sign(ips_dir = 'pkg')
packages = Dir["#{ips_dir}/**/*.p5p"]
return if packages.empty?

Pkg::Util::Gpg.load_keychain if Pkg::Util::Tool.find_tool('keychain')
packages.each do |p5p_package|
Pkg::Util::Gpg.sign_file(p5p_package)
end
end
end
3 changes: 1 addition & 2 deletions tasks/nightly_repos.rake
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,7 @@ namespace :pl do
Pkg::Rpm::Repo.sign_repos('repos')
Pkg::Deb::Repo.sign_repos('repos', 'Apt repository for signed builds')
Pkg::Sign::Dmg.sign('repos') unless Dir['repos/apple/**/*.dmg'].empty?
### RE-16211: we should put this back and unify with the code in sign.rake
# Pkg::Sign::Ips.sign('repos') unless Dir['repos/solaris/11/**/*.p5p'].empty?
Pkg::Sign::Ips.sign('repos') unless Dir['repos/solaris/11/**/*.p5p'].empty?
Pkg::Sign::Msi.sign('repos') unless Dir['repos/windows/**/*.msi'].empty?
end

Expand Down
9 changes: 2 additions & 7 deletions tasks/sign.rake
Original file line number Diff line number Diff line change
Expand Up @@ -45,13 +45,8 @@ namespace :pl do
desc "Sign ips package, defaults to PL key, pass GPG_KEY to override"
task :sign_ips, :root_dir do |_t, args|
ips_dir = args.root_dir || $DEFAULT_DIRECTORY
packages = Dir["#{ips_dir}/**/*.p5p"]
next if packages.empty?

Pkg::Util::Gpg.load_keychain if Pkg::Util::Tool.find_tool('keychain')
packages.each do |p5p_package|
Pkg::Util::Gpg.sign_file p5p_package
end
next if Dir["#{ips_dir}/**/*.p5p"].empty?
Pkg::Sign::Ips.sign(ips_dir)
end

desc "Sign built gems, defaults to PL key, pass GPG_KEY to override or edit build_defaults"
Expand Down

0 comments on commit d91c2d9

Please sign in to comment.