tasks/nightly_repos.rake in packaging-0.106.0 vs tasks/nightly_repos.rake in packaging-0.106.1
- old
+ new
@@ -19,15 +19,15 @@
signing_bundle = ENV['SIGNING_BUNDLE']
remote_repo = Pkg::Util::Net.remote_unpack_git_bundle(signing_server, 'HEAD', nil, signing_bundle)
build_params = Pkg::Util::Net.remote_buildparams(signing_server, Pkg::Config)
Pkg::Util::Net.rsync_to('repos', signing_server, remote_repo)
- rake_command = <<-DOC
-cd #{remote_repo} ;
-#{Pkg::Util::Net.remote_bundle_install_command}
-bundle exec rake pl:jenkins:sign_repos GPG_KEY=#{Pkg::Util::Gpg.key} PARAMS_FILE=#{build_params}
-DOC
+ rake_command = <<~DOC
+ cd #{remote_repo} ;
+ #{Pkg::Util::Net.remote_bundle_install_command}
+ bundle exec rake pl:jenkins:sign_repos GPG_KEY=#{Pkg::Util::Gpg.key} PARAMS_FILE=#{build_params}
+ DOC
Pkg::Util::Net.remote_execute(signing_server, rake_command)
Pkg::Util::Net.rsync_from("#{remote_repo}/repos/", signing_server, target)
Pkg::Util::Net.remote_execute(signing_server, "rm -rf #{remote_repo}")
Pkg::Util::Net.remote_execute(signing_server, "rm #{build_params}")
puts "Signed packages staged in '#{target}' directory"
@@ -52,25 +52,25 @@
Pkg::Util::Net.rsync_to("#{target_prefix}_repos/", Pkg::Config.distribution_server, target_dir)
end
end
# This task should be invoked after prepare_signed_repos, so that there are repos to pack up.
- task :pack_signed_repo, [:path_to_repo, :name_of_archive, :versioning] => ["pl:fetch"] do |t, args|
+ task :pack_signed_repo, %i[path_to_repo name_of_archive versioning] => ["pl:fetch"] do |t, args|
# path_to_repo should be relative to ./pkg
path_to_repo = args.path_to_repo or fail ":path_to_repo is a required argument for #{t}"
name_of_archive = args.name_of_archive or fail ":name_of_archive is a required argument for #{t}"
versioning = args.versioning or fail ":versioning is a required argument for #{t}"
Pkg::Repo.create_signed_repo_archive(path_to_repo, name_of_archive, versioning)
end
- task :pack_all_signed_repos_individually, [:name_of_archive, :versioning] => ["pl:fetch"] do |t, args|
+ task :pack_all_signed_repos_individually, %i[name_of_archive versioning] => ["pl:fetch"] do |t, args|
name_of_archive = args.name_of_archive or fail ":name_of_archive is a required argument for #{t}"
versioning = args.versioning or fail ":versioning is a required argument for #{t}"
Pkg::Repo.create_all_repo_archives(name_of_archive, versioning)
end
- task :prepare_signed_repos, [:target_host, :target_prefix, :versioning] => ["clean", "pl:fetch"] do |t, args|
+ task :prepare_signed_repos, %i[target_host target_prefix versioning] => ["clean", "pl:fetch"] do |t, args|
target_host = args.target_host or fail ":target_host is a required argument to #{t}"
target_prefix = args.target_prefix or fail ":target_prefix is a required argument for #{t}"
versioning = args.versioning or fail ":versioning is a required argument for #{t}"
mkdir("pkg")
@@ -138,11 +138,11 @@
# Make a latest symlink for the project
FileUtils.ln_sf(File.join("..", local_target, "repos"), File.join(Pkg::Config.project + "-latest"), :verbose => true)
end
end
- task :deploy_signed_repos, [:target_host, :target_basedir, :foss_only] => "pl:fetch" do |t, args|
+ task :deploy_signed_repos, %i[target_host target_basedir foss_only] => "pl:fetch" do |t, args|
target_host = args.target_host or fail ":target_host is a required argument to #{t}"
target_basedir = args.target_basedir or fail ":target_basedir is a required argument to #{t}"
include_paths = []
if args.foss_only && Pkg::Config.foss_platforms && !Pkg::Config.foss_platforms.empty?
@@ -156,26 +156,26 @@
include_paths = ["./"]
end
# Get the directories together - we need to figure out which bits to ship based on the include_path
# First we get the build itself
- Pkg::Util::Execution.capture3(%(find #{include_paths.map { |path| "pkg/#{Pkg::Config.project}/**/#{path}" }.join(' ') } | sort > include_file))
+ Pkg::Util::Execution.capture3(%(find #{include_paths.map { |path| "pkg/#{Pkg::Config.project}/**/#{path}" }.join(' ')} | sort > include_file))
Pkg::Util::Execution.capture3(%(mkdir -p tmp && tar -T include_file -cf - | (cd ./tmp && tar -xf -)))
# Then we find grab the appropriate meta-data only
- Pkg::Util::Execution.capture3(%(find #{include_paths.map { |path| "pkg/#{Pkg::Config.project}-latest/#{path}" unless path.include? "repos" }.join(' ') } | sort > include_file_latest))
+ Pkg::Util::Execution.capture3(%(find #{include_paths.map { |path| "pkg/#{Pkg::Config.project}-latest/#{path}" unless path.include? 'repos' }.join(' ')} | sort > include_file_latest))
#include /repos in the include_file_latest so we correctly include the symlink in the final file list to ship
Pkg::Util::Execution.capture3(%(echo "pkg/#{Pkg::Config.project}-latest/repos" >> include_file_latest))
Pkg::Util::Execution.capture3(%(tar -T include_file_latest -cf - | (cd ./tmp && tar -xf -)))
Dir.chdir("tmp/pkg") do
# Ship it to the target for consumption
# First we ship the latest and clean up any repo-configs that are no longer valid with --delete-after
Pkg::Util::Net.rsync_to("#{Pkg::Config.project}-latest", target_host, target_basedir, extra_flags: ["--delete-after", "--keep-dirlinks"])
# Then we ship the sha version with default rsync flags
- Pkg::Util::Net.rsync_to("#{Pkg::Config.project}", target_host, target_basedir)
+ Pkg::Util::Net.rsync_to(Pkg::Config.project.to_s, target_host, target_basedir)
end
puts "'#{Pkg::Config.ref}' of '#{Pkg::Config.project}' has been shipped to '#{target_host}:#{target_basedir}'"
end
@@ -223,11 +223,11 @@
# ex: /opt/puppet-agent
# @param versioning whether the puppet-agent version is a version string or
# a github ref. Valid values are 'version' and 'ref'
# @param pe_version the PE-version to deploy to.
# ex: 2015.2
- task :link_signed_repos, [:target_host, :remote_dir, :versioning, :pe_version] => ["pl:fetch"] do |t, args|
+ task :link_signed_repos, %i[target_host remote_dir versioning pe_version] => ["pl:fetch"] do |t, args|
target_host = args.target_host or fail ":target_host is a required argument for #{t}"
remote_dir = args.remote_dir or fail ":remote_dir is a required argument for #{t}"
versioning = args.versioning or fail ":versioning is a required argument for #{t}"
pe_version = args.pe_version or fail ":pe_version is a required argument for #{t}"
@@ -253,10 +253,10 @@
task :nightly_repos => ["pl:fetch"] do
Pkg::Util::RakeUtils.invoke_task("pl:jenkins:generate_signed_repos", 'nightly')
end
- task :deploy_nightly_repos, [:target_host, :target_basedir] => ["pl:fetch"] do |t, args|
+ task :deploy_nightly_repos, %i[target_host target_basedir] => ["pl:fetch"] do |t, args|
target_host = args.target_host or fail ":target_host is a required argument to #{t}"
target_basedir = args.target_basedir or fail ":target_basedir is a required argument to #{t}"
Pkg::Util::RakeUtils.invoke_task("pl:jenkins:prepare_signed_repos", target_host, 'nightly', 'ref')
Pkg::Util::RakeUtils.invoke_task("pl:jenkins:deploy_signed_repos", target_host, target_basedir, true)
end