From b2b73826137c275b9cae396a4bec09695e0b1660 Mon Sep 17 00:00:00 2001 From: Vladimir Sharshov Date: Mon, 5 Sep 2011 18:40:49 +0400 Subject: [PATCH] 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 --- app/controllers/build_lists_controller.rb | 4 ++-- app/models/build_list.rb | 2 +- lib/build_server.rb | 4 ++-- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/app/controllers/build_lists_controller.rb b/app/controllers/build_lists_controller.rb index 5a16e3f28..428b5ccc8 100644 --- a/app/controllers/build_lists_controller.rb +++ b/app/controllers/build_lists_controller.rb @@ -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])) diff --git a/app/models/build_list.rb b/app/models/build_list.rb index 11c97d43c..9803acd88 100644 --- a/app/models/build_list.rb +++ b/app/models/build_list.rb @@ -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 diff --git a/lib/build_server.rb b/lib/build_server.rb index 517257929..31da95afd 100644 --- a/lib/build_server.rb +++ b/lib/build_server.rb @@ -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