From: donghee yang Date: Fri, 17 Aug 2012 08:18:31 +0000 (+0900) Subject: [Title] Added build server configuration for package sync period X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=6d536f6eccd165c7e81e847520da4197f834c6a8;p=sdk%2Ftools%2Fsdk-build.git [Title] Added build server configuration for package sync period --- diff --git a/src/build_server/BuildServer.rb b/src/build_server/BuildServer.rb index 6a5ee76..551f79b 100644 --- a/src/build_server/BuildServer.rb +++ b/src/build_server/BuildServer.rb @@ -59,6 +59,7 @@ class BuildServer attr_accessor :cancel_lock attr_accessor :supported_os_list attr_accessor :remote_pkg_servers + attr_accessor :pkg_sync_period CONFIG_ROOT = "#{Utils::HOME}/.build_tools/build_server" HOST_OS = Utils::HOST_OS @@ -106,6 +107,8 @@ class BuildServer @outgoing_path = "#{@path}/outgoing" @cancel_lock = Mutex.new @supported_os_list = [] + + @pkg_sync_period=600 end diff --git a/src/build_server/BuildServerController.rb b/src/build_server/BuildServerController.rb index 78ba035..8b5ca4b 100644 --- a/src/build_server/BuildServerController.rb +++ b/src/build_server/BuildServerController.rb @@ -511,6 +511,7 @@ class BuildServerController f.puts "FTP_PORT=#{server.ftp_port}" f.puts "FTP_USERNAME=#{server.ftp_username}" f.puts "FTP_PASSWD=#{server.ftp_passwd}" + f.puts "PKG_SYNC_PERIOD=#{server.pkg_sync_period}" end end @@ -535,6 +536,7 @@ class BuildServerController ftp_port="21" ftp_username="" ftp_passwd="" + pkg_sync_period=600 # read configuration server_dir = "#{BuildServer::CONFIG_ROOT}/#{id}" @@ -579,6 +581,8 @@ class BuildServerController ftp_username = l[idx,length].strip elsif l.start_with?("FTP_PASSWD=") ftp_passwd = l[idx,length].strip + elsif l.start_with?("PKG_SYNC_PERIOD=") + pkg_sync_period = l[idx,length].strip.to_i else next end @@ -663,6 +667,9 @@ class BuildServerController obj.ftp_username = ftp_username obj.ftp_passwd = ftp_passwd + # pkg synchronization + obj.pkg_sync_period = pkg_sync_period + # save config write_server_config( obj ) diff --git a/src/build_server/PackageSync.rb b/src/build_server/PackageSync.rb index 67fbaab..07655ef 100644 --- a/src/build_server/PackageSync.rb +++ b/src/build_server/PackageSync.rb @@ -39,7 +39,7 @@ class PackageSyncAction < Action @@new_id = 0 def initialize( time, url, proxy, server ) - super(time, 600) + super(time, server.pkg_sync_period) my_id = @@new_id @@new_id += 1 @pkgsvr_url = url diff --git a/test/bin/bin_0.0.1_ubuntu-32.zip b/test/bin/bin_0.0.1_ubuntu-32.zip new file mode 100644 index 0000000..9c21aca Binary files /dev/null and b/test/bin/bin_0.0.1_ubuntu-32.zip differ diff --git a/test/pkgsvr2.init b/test/pkgsvr2.init new file mode 100755 index 0000000..e97681c --- /dev/null +++ b/test/pkgsvr2.init @@ -0,0 +1,7 @@ +#!/bin/sh +rm -rf ~/.build_tools/pkg_server/pkgsvr02 +rm -rf `pwd`/pkgsvr02 +ruby -d ../pkg-svr create -n pkgsvr02 -d unstable +ruby -d ../pkg-svr add-os -n pkgsvr02 -d unstable -o ubuntu-32 +ruby -d ../pkg-svr add-os -n pkgsvr02 -d unstable -o windows-32 +ruby -d ../pkg-svr start -n pkgsvr02 -p 4444