rosa-build/lib/tasks/build.rake

26 lines
921 B
Ruby
Raw Normal View History

require 'highline/import'
require 'open-uri'
namespace :build do
desc "Build projects from list"
task :projects => :environment do
source = ENV['SOURCE'] || 'http://dl.dropbox.com/u/984976/rebuild_list.txt'
2012-03-07 23:47:48 +00:00
owner = User.find_by_uname!(ENV['OWNER'] || 'warpc')
platform = Platform.find_by_name!(ENV['PLATFORM'] || 'rosa2012lts')
arch = Arch.find_by_name!(ENV['ARCH'] || 'i586')
2012-03-07 23:47:48 +00:00
say "START build projects from #{source} for platform=#{platform.name}, owner=#{owner.uname}, arch=#{arch.name}"
open(source).readlines.each do |name|
name.chomp!; name.strip! #; name.downcase!
if p = Project.joins(:repositories).where('repositories.id IN (?)', platform.repositories).find_by_name(name)
2012-12-25 12:03:41 +00:00
# Old code p.build_for(platform, owner, arch)
say "== Build #{p.name} =="
else
say "== Not found #{name} =="
end
sleep 0.2
end
say 'DONE'
end
end