installer/utils/package_upload/repos.rake in rhoconnect-3.2.0.beta2 vs installer/utils/package_upload/repos.rake in rhoconnect-3.2.0.beta3
- old
+ new
@@ -76,11 +76,11 @@
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
+ # Get rid of '.' before extension name
dest_dir[0] = ''
if dest_dir == 'deb' || dest_dir == 'rpm'
if dest_dir == 'deb'
@deb_pkg = File.basename(file)
end #if
@@ -93,26 +93,23 @@
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_number.empty?
+ # Change name of packages to include build number
+ ['deb', 'rpm'].each do |arch|
+ Find.find("#{PKG_DIR}") do |file|
+ if !File.directory?(file) and file =~ /#{arch}$/
+ file_to_rename = File.open(file, 'r')
+ old_name = File.expand_path(file)
+ new_name = old_name.gsub(/(#{arch})$/, "#{build_number}.\\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"
@@ -123,6 +120,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