Update BuildServer

- Change xml-rpc call function (add_build_list).
  Add id, that identify project new_bbbt and assign bs_id
- Add find_build_list_by_bs  to post_build call
This commit is contained in:
Vladimir Sharshov 2011-09-05 18:40:49 +04:00
parent b25a174613
commit b2b7382613
3 changed files with 5 additions and 5 deletions

View File

@ -7,7 +7,7 @@ class BuildListsController < ApplicationController
before_filter :find_arches, :only => [:index, :filter]
before_filter :find_branches, :only => [:index, :filter]
before_filter :find_build_list_by_bs, :only => [:status_build, :pre_build, :new_bbdt]
before_filter :find_build_list_by_bs, :only => [:status_build, :pre_build, :post_build]
def index
@build_lists = @project.build_lists.recent.paginate :page => params[:page]
@ -41,7 +41,6 @@ class BuildListsController < ApplicationController
def pre_build
@build_list.status = BuildList::BUILD_STARTED
@build_list.container_path = params[:container_path]
@build_list.notified_at = Time.now
@build_list.save
@ -70,6 +69,7 @@ class BuildListsController < ApplicationController
end
def new_bbdt
@build_list = BuildList.find_by_id!(params[:web_id])
@build_list.name = params[:name]
@build_list.additional_repos = ActiveSupport::JSON.decode(params[:additional_repos])
@build_list.set_items(ActiveSupport::JSON.decode(params[:items]))

View File

@ -89,7 +89,7 @@ class BuildList < ActiveRecord::Base
end
def place_build
self.status = BuildServer.add_build_list project.name, branch_name, project.repository.platform.name, arch.name
self.status = BuildServer.add_build_list project.name, branch_name, project.repository.platform.name, arch.name, id
self.status = BUILD_PENDING if self.status == 0
save
end

View File

@ -68,8 +68,8 @@ class BuildServer
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)
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)
end
def self.freeze platform_name, new_repo_name = nil