BuildServer XML-RPC core interface

This commit is contained in:
Alexey Nayden 2011-04-06 01:35:22 +04:00
parent 2bade85793
commit cd365d4d45
1 changed files with 70 additions and 0 deletions

70
lib/build_server.rb Normal file
View File

@ -0,0 +1,70 @@
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
@@client ||= XMLRPC::Client.new(:host => AppConfig['build_server_ip'], :port => AppConfig['build_server_port'], :path => AppConfig['build_server_path'])
end
def self.add_platform name, root_folder, repos = [], git_path = nil
self.client.call('add_platform', name, git_path, root_folder, repos)
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
self.client.call('create_repo', name, platform_name)
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
self.client.call('create_project', name, platform_name, repo_name)
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
def self.add_build_list project_name, branch_name, platform_name, arch_name
self.client.call('add_build_list', project_name, branch_name, platform_name, arch_name)
end
end