installer/utils/package_upload/repos.rake in rhoconnect-3.1.2 vs installer/utils/package_upload/repos.rake in rhoconnect-3.2.0.beta1

- old
+ new

@@ -16,23 +16,25 @@ build_type = args[:build_type] build_number = args[:build_number] # CONSTANTS - PKG_DIR = case build_type - when 'release' - '/packages' - when 'test' - '/test-packages' - when 'beta' - '/beta-packages' - else 'nightly' - '/nightly-packages' - end #case - - BUCKET = 'rhoconnect' + RHOCONNECT_ROOT = File.expand_path(File.join(File.dirname(__FILE__), '..', '..', '..', '..')) + PKG_DIR = case build_type + when 'release' + '/packages' + when 'test' + '/test-packages' + when 'beta' + '/beta-packages' + else 'nightly' + '/nightly-packages' + end #case + + BUCKET = 'rhoconnect' + def cmd(cmd) puts cmd puts `#{cmd}` end #cmd @@ -68,10 +70,12 @@ cmd "sudo mkdir -p #{PKG_DIR}/rpm" unless File.directory?("#{PKG_DIR}/rpm") end #prepare_destination def copy_files + # Move back into rhoconnect repo root first + Dir.chdir RHOCONNECT_ROOT # Copy the packages to their respective directory Find.find('./pkg') do |file| if !FileTest.directory?(file) dest_dir = File.extname(file) # get rid of '.' before extension name @@ -86,29 +90,29 @@ end #if end #do end #copy_files prepare_destination - + copy_files - if build_type != "release" && - build_type != "test" - # Change name of packages to include build number - ['deb', 'rpm'].each do |arch| - Find.find("#{PKG_DIR}") do |file| - if !File.directory?(file) && - file =~ /#{arch}$/ - file_to_rename = File.open(file, 'r') - old_name = File.expand_path(file) - puts "Old Name:\t#{old_name}" - new_name = old_name.gsub(/(#{arch})$/, "build-#{build_number.to_s}.\\1" ) - File.rename(old_name, new_name) - end #if - end #do - end #do - end #if + # if build_type != "release" && + # build_type != "test" + # # Change name of packages to include build number + # ['deb', 'rpm'].each do |arch| + # Find.find("#{PKG_DIR}") do |file| + # if !File.directory?(file) && + # file =~ /#{arch}$/ + # file_to_rename = File.open(file, 'r') + # old_name = File.expand_path(file) + # puts "Old Name:\t#{old_name}" + # new_name = old_name.gsub(/(#{arch})$/, "build-#{build_number.to_s}.\\1" ) + # File.rename(old_name, new_name) + # end #if + # end #do + # end #do + # end #if # REPOIFY! cmd "sudo reprepro -b #{PKG_DIR}/deb includedeb rhoconnect #{PKG_DIR}/deb/#{@deb_pkg}" cmd "sudo createrepo #{PKG_DIR}/rpm" @@ -119,6 +123,6 @@ # Call s3_upload.rb ['deb', 'rpm'].each do |dir| cmd "sudo ruby ./installer/utils/package_upload/s3_upload.rb #{PKG_DIR}/#{dir} #{BUCKET}" end #do cmd "sudo ruby ./installer/utils/package_upload/s3_upload.rb #{PKG_DIR}/SHA1 #{BUCKET}" -end #build:repos \ No newline at end of file +end #build:repos