From: donghee yang Date: Thu, 23 Aug 2012 09:30:07 +0000 (+0900) Subject: [Title] Removed LocalBuildJob.rb X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=06b52ab5d3baac6a998bf1a308aaa3ecebfb8735;p=sdk%2Ftools%2Fsdk-build.git [Title] Removed LocalBuildJob.rb --- diff --git a/src/build_server/BuildServer.rb b/src/build_server/BuildServer.rb index 3690cb5..8f6714b 100644 --- a/src/build_server/BuildServer.rb +++ b/src/build_server/BuildServer.rb @@ -30,7 +30,6 @@ require 'fileutils' $LOAD_PATH.unshift File.dirname(__FILE__) require "SocketJobRequestListener.rb" require "RemoteBuildJob.rb" -require "LocalBuildJob.rb" require "JobManager.rb" require "JobClean.rb" require "RemoteBuildServer.rb" diff --git a/src/build_server/JobManager.rb b/src/build_server/JobManager.rb index 9647f02..2372d3b 100644 --- a/src/build_server/JobManager.rb +++ b/src/build_server/JobManager.rb @@ -32,7 +32,6 @@ $LOAD_PATH.unshift File.dirname(__FILE__) $LOAD_PATH.unshift File.dirname(File.dirname(__FILE__))+"/pkg_server" require "SocketJobRequestListener.rb" require "RemoteBuildJob.rb" -require "LocalBuildJob.rb" require "RegisterPackageJob.rb" require "packageServer.rb" diff --git a/src/build_server/LocalBuildJob.rb b/src/build_server/LocalBuildJob.rb deleted file mode 100644 index 0eb1878..0000000 --- a/src/build_server/LocalBuildJob.rb +++ /dev/null @@ -1,151 +0,0 @@ -=begin - - LocalBuildJob.rb - -Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved. - -Contact: -Taejun Ha -Jiil Hyoun -Donghyuk Yang -DongHee Yang - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - -http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. - -Contributors: -- S-Core Co., Ltd -=end - -$LOAD_PATH.unshift File.dirname(__FILE__) -$LOAD_PATH.unshift File.dirname(File.dirname(__FILE__))+"/common" -require "BuildJob.rb" -require "utils.rb" - -class LocalBuildJob < BuildJob - attr_accessor :id, :status, :pkginfo, :pkgsvr_client, :thread, :log, :rev_fail_list, :rev_success_list, :source_path - - # initialize - def initialize (local_path, os, pkgsvr_url, options, server, parent, outstream, resolve ) - super(server.jobmgr.get_new_job_id(), server) - @rev_fail_list = [] - @rev_success_list = [] - @parent = parent - @local_path = local_path - @os = os - @host_os = Utils::HOST_OS - @pkgserver_url = pkgsvr_url - @options = options - @resolve = resolve - @outstream = outstream - - @status = "JUST_CREATED" - @sub_jobs = [] - @job_root = "#{@server.path}/jobs/#{@id}" - @source_path = @local_path - @pkginfo = nil - @pkgsvr_client = nil - @job_working_dir=@job_root+"/works" - - @thread = nil - - # mkdir - FileUtils.rm_rf "#{@server.path}/jobs/#{@id}" - FileUtils.mkdir_p "#{@server.path}/jobs/#{@id}" - - # create logger - @log = JobLog.new( self, "#{@server.path}/jobs/#{@id}/log", outstream ) - end - - - def terminate() - - # report error - if @status == "ERROR" then - @log.error( "Job is stopped by ERROR", Log::LV_USER) - @server.cleaner.clean_afterwards(@id) - else - # if succeeded, clean up - @server.cleaner.clean(@id) - end - - # clean up builder directory if exist? - if Builder.exist? "JB#{@id}" then - Builder.remove("JB#{@id}") - end - - # send mail - if ( @server.send_mail.eql? "YES" ) and ( not @pkginfo.nil? ) and ( not @pkginfo.packages.nil? ) then - mail_list = [] - contents = [] - contents.push " " - contents.push "%-30s| %10s | %10s" % ["package name", "version", "os"] - contents.push "---------------------------------------------------------------" - for pkg in @pkginfo.packages - if not pkg.os.eql? @os then next end - mail_list = mail_list | Mail.parse_email( pkg.maintainer ) - contents.push("%-30s| %10s | %10s" % [ pkg.package_name, pkg.version, pkg.os] ) - end - - if @status == "ERROR" then - subject = "[DIBS] Build fail" - contents.push " " - contents.push "check log file" - contents.push "* Log : #{@server.job_log_url}/#{@id}/log" - else - subject = "[DIBS] Build success" - end - Mail.send_mail(mail_list, subject, contents.join("\n")) - end - - # close logger - @log.close - - # send END signal , if connectionn is valid - if @status != "ERROR" and not @outstream.nil? then - BuildCommServer.send_end(@outstream) - end - - # close outstream - if not @outstream.nil? then - BuildCommServer.disconnect( @outstream ) - end - end - - - # verify - def pre_verify - @log.info( "Verifying job input...", Log::LV_USER) - - # check pkginfo.manifest - if not File.exist? "#{@source_path}/package/pkginfo.manifest" - @log.error( "#{@source_path}/package/pkginfo.manifest does not exist", Log::LV_USER) - @status = "ERROR" - return false - end - - # set pkginfo - begin - @pkginfo = PackageManifest.new("#{@source_path}/package/pkginfo.manifest") - rescue => e - @log.error( e.message, Log::LV_USER) - @status = "ERROR" - return false - end - - # set up pkgsvr_client - @pkgsvr_client = Client.new(@pkgserver_url, @job_working_dir, @log) - - return true - end - -end