Rescue and ignore timeout error during long XML RPC. Apply add_branch script. Refs #207
This commit is contained in:
parent
b192ebdcea
commit
a2a29e2baa
|
@ -28,33 +28,35 @@ class BuildServer
|
|||
self.client.call('add_platform', name, platforms_root_folder, repos, distrib_type)
|
||||
end
|
||||
|
||||
|
||||
def self.delete_platform name
|
||||
self.client.call('delete_platform', name)
|
||||
rescue Timeout::Error => e # TODO remove this when core will be ready
|
||||
0
|
||||
end
|
||||
|
||||
|
||||
def self.clone_platform new_name, old_name, new_root_folder
|
||||
self.client.call('clone_platform', new_name, old_name, new_root_folder)
|
||||
rescue Timeout::Error => e # TODO remove this when core will be ready
|
||||
0
|
||||
end
|
||||
|
||||
|
||||
def self.create_repo name, platform_name
|
||||
self.client.call('create_repository', name, platform_name)
|
||||
end
|
||||
|
||||
|
||||
def self.delete_repo name, platform_name
|
||||
self.client.call('delete_repository', name, platform_name)
|
||||
rescue Timeout::Error => e # TODO remove this when core will be ready
|
||||
0
|
||||
end
|
||||
|
||||
def self.clone_repo new_name, old_name, new_platform_name
|
||||
tmp = self.client.timeout # TODO remove this when core will be ready
|
||||
self.client.timeout = 30.minutes
|
||||
self.client.call('clone_repo', new_name, old_name, new_platform_name)
|
||||
self.client.timeout = tmp
|
||||
rescue Timeout::Error => e # TODO remove this when core will be ready
|
||||
0
|
||||
end
|
||||
|
||||
|
||||
def self.publish_container container_id
|
||||
self.client.call('publish_container', container_id)
|
||||
end
|
||||
|
|
|
@ -0,0 +1,22 @@
|
|||
require 'highline/import'
|
||||
|
||||
desc "Add branch for platform projects"
|
||||
task :add_branch => :environment do
|
||||
src_branch = ENV['SRC_BRANCH'] || 'import_mandriva2011'
|
||||
dst_branch = ENV['DST_BRANCH'] || 'rosa2012lts'
|
||||
|
||||
say "START add branch #{dst_branch} from #{src_branch}"
|
||||
Platform.find_by_name(dst_branch).repositories.each do |r|
|
||||
say "=== Process #{r.name} repo"
|
||||
r.projects.find_each do |p|
|
||||
say "===== Process #{p.name} project"
|
||||
tmp_path = Rails.root.join('tmp', p.name)
|
||||
system("git clone #{p.path} #{tmp_path}")
|
||||
system("cd #{tmp_path} && git checkout remotes/origin/#{src_branch}") or system("cd #{tmp_path} && git checkout master")
|
||||
system("cd #{tmp_path} && git checkout -b #{dst_branch}")
|
||||
system("cd #{tmp_path} && git push origin HEAD")
|
||||
FileUtils.rm_rf tmp_path
|
||||
end
|
||||
end
|
||||
say 'DONE'
|
||||
end
|
Loading…
Reference in New Issue