2012-03-07 23:25:17 +00:00
|
|
|
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:25:17 +00:00
|
|
|
|
2012-03-07 23:47:48 +00:00
|
|
|
say "START build projects from #{source} for platform=#{platform.name}, owner=#{owner.uname}, arch=#{arch.name}"
|
2012-03-07 23:25:17 +00:00
|
|
|
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-03-07 23:47:48 +00:00
|
|
|
p.build_for(platform, owner, arch)
|
2012-03-07 23:25:17 +00:00
|
|
|
say "== Build #{p.name} =="
|
|
|
|
else
|
|
|
|
say "== Not found #{name} =="
|
|
|
|
end
|
|
|
|
sleep 0.2
|
|
|
|
end
|
|
|
|
say 'DONE'
|
|
|
|
end
|
|
|
|
end
|