if @build.build_pe namespace :pe do desc "ship PE rpms to #{@build.yum_host}" task :ship_rpms => "pl:fetch" do if empty_dir?("pkg/pe/rpm") STDERR.puts "The 'pkg/pe/rpm' directory has no packages. Did you run rake pe:deb?" exit 1 else target_path = ENV['YUM_REPO'] ? ENV['YUM_REPO'] : "#{@build.yum_repo_path}/#{@build.pe_version}/repos/" rsync_to('pkg/pe/rpm/', @build.yum_host, target_path) if @build.team == 'release' Rake::Task["pe:remote:update_yum_repo"].invoke end end end desc "Ship PE debs to #{@build.apt_host}" task :ship_debs => "pl:fetch" do dist = @build.default_cow.split('-')[1] if empty_dir?("pkg/pe/deb/#{dist}") STDERR.puts "The 'pkg/pe/deb/#{dist}' directory has no packages. Did you run rake pe:deb?" exit 1 else target_path = ENV['APT_REPO'] ? ENV['APT_REPO'] : "#{@build.apt_repo_path}/#{@build.pe_version}/repos/incoming/unified/" rsync_to("pkg/pe/deb/#{dist}/", @build.apt_host, target_path) if @build.team == 'release' Rake::Task["pe:remote:freight"].invoke end end end namespace :remote do desc "Update remote rpm repodata for PE on #{@build.yum_host}" task :update_yum_repo => "pl:fetch" do remote_ssh_cmd(@build.yum_host, "for dir in $(find #{@build.apt_repo_path}/#{@build.pe_version}/repos/el* -type d | grep -v repodata | grep -v cache | xargs) ; do pushd $dir; sudo rm -rf repodata; createrepo -q -d .; popd &> /dev/null ; done; sync") end # This is particularly hacky. The 'pe-the-things' script resides on the @build.apt_host and takes packages placed # in the directory/structure shown in the rsync target of pe:ship_debs and adds them to the remote PE # freight repository and updates the apt repo metadata desc "remote freight PE packages to #{@build.apt_host}" task :freight => "pl:fetch" do remote_ssh_cmd(@build.apt_host, "sudo pe-the-things #{@build.pe_version} #{@build.apt_repo_path} #{@build.freight_conf}") end end end end