2011-04-05 22:35:22 +01:00
|
|
|
require 'xmlrpc/client'
|
|
|
|
class BuildServer
|
|
|
|
|
|
|
|
SUCCESS = 0
|
|
|
|
ERROR = 1
|
|
|
|
|
|
|
|
PLATFORM_NOT_FOUND = 1
|
|
|
|
PLATFORM_PENDING = 2
|
|
|
|
PROJECT_NOT_FOUND = 3
|
|
|
|
BRANCH_NOT_FOUND = 4
|
|
|
|
|
|
|
|
BUILD_ERROR = 2500
|
|
|
|
MOCK_NOT_FOUND = 256
|
|
|
|
DEPENDENCIES_FAIL = 7680
|
|
|
|
SRPM_NOT_FOUND = 12800
|
|
|
|
|
|
|
|
def self.client
|
2011-04-14 08:23:08 +01:00
|
|
|
@@client ||= XMLRPC::Client.new3('host' => APP_CONFIG['build_server_ip'], 'port' => APP_CONFIG['build_server_port'], 'path' => APP_CONFIG['build_server_path'])
|
2011-04-05 22:35:22 +01:00
|
|
|
end
|
|
|
|
|
|
|
|
|
2011-04-14 11:45:30 +01:00
|
|
|
def self.add_platform name, root_folder, repos = {:src => [], :rpm => []}
|
2011-04-14 10:25:29 +01:00
|
|
|
self.client.call('add_platform', name, root_folder, repos)
|
2011-04-05 22:35:22 +01:00
|
|
|
end
|
|
|
|
|
|
|
|
|
|
|
|
def self.delete_platform name
|
|
|
|
self.client.call('delete_platform', name)
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
|
|
def self.clone_platform new_name, old_name, new_root_folder
|
|
|
|
self.client.call('clone_platform', new_name, old_name, new_root_folder)
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
|
|
def self.create_repo name, platform_name
|
2011-04-07 10:27:30 +01:00
|
|
|
self.client.call('create_repository', name, platform_name)
|
2011-04-05 22:35:22 +01:00
|
|
|
end
|
|
|
|
|
|
|
|
|
2011-04-07 10:27:30 +01:00
|
|
|
def self.delete_repo name, platform_name
|
|
|
|
self.client.call('delete_repository', name, platform_name)
|
2011-04-05 22:35:22 +01:00
|
|
|
end
|
|
|
|
|
|
|
|
def self.clone_repo new_name, old_name, new_platform_name
|
|
|
|
self.client.call('clone_repo', new_name, old_name, new_platform_name)
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
|
|
def self.publish_container container_id
|
|
|
|
self.client.call('publish_container', container_id)
|
|
|
|
end
|
|
|
|
|
|
|
|
def self.delete_container container_id
|
|
|
|
self.client.call('delete_container', container_id)
|
|
|
|
end
|
|
|
|
|
|
|
|
def self.create_project name, platform_name, repo_name
|
2011-04-15 14:40:40 +01:00
|
|
|
self.client.call('create_project', name, repo_name, platform_name)
|
2011-04-05 22:35:22 +01:00
|
|
|
end
|
|
|
|
|
|
|
|
def self.delete_project name, platform_name
|
|
|
|
self.client.call('delete_project', name, platform_name)
|
|
|
|
end
|
|
|
|
|
|
|
|
def self.add_to_repo name, repo_name
|
|
|
|
self.client.call('add_to_repo', name, repo_name)
|
|
|
|
end
|
|
|
|
|
2011-09-05 15:40:49 +01:00
|
|
|
def self.add_build_list project_name, branch_name, platform_name, arch_name, web_id
|
|
|
|
self.client.call('add_build_list', project_name, branch_name, platform_name, arch_name, web_id)
|
2011-04-05 22:35:22 +01:00
|
|
|
end
|
2011-04-11 09:34:50 +01:00
|
|
|
|
|
|
|
def self.freeze platform_name, new_repo_name = nil
|
|
|
|
self.client.call('freeze_platform', platform_name, new_repo_name)
|
|
|
|
end
|
2011-04-05 22:35:22 +01:00
|
|
|
end
|