7 Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved.
10 Taejun Ha <taejun.ha@samsung.com>
11 Jiil Hyoun <jiil.hyoun@samsung.com>
12 Donghyuk Yang <donghyuk.yang@samsung.com>
13 DongHee Yang <donghee.yang@samsung.com>
15 Licensed under the Apache License, Version 2.0 (the "License");
16 you may not use this file except in compliance with the License.
17 You may obtain a copy of the License at
19 http://www.apache.org/licenses/LICENSE-2.0
21 Unless required by applicable law or agreed to in writing, software
22 distributed under the License is distributed on an "AS IS" BASIS,
23 WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
24 See the License for the specific language governing permissions and
25 limitations under the License.
32 $LOAD_PATH.unshift File.dirname(__FILE__)+"/src/common"
33 $LOAD_PATH.unshift File.dirname(__FILE__)+"/src/build_server"
35 require "BuildServerOptionParser"
36 require "BuildServerController"
42 puts "Option parse error"
48 # if "--os" is not specified, use host os type
49 if option[:os].nil? then
50 host_os = `uname -s`.strip
55 option[:os] = "windows"
57 option[:os] = "darwin"
59 if not option[:os] =~ /^(linux|windows|darwin)$/ then
60 puts "We have no plan to Buld OS \"#{option[:os]}\" \n please check your option OS "
65 if not option[:os] =~ /^(linux|windows|darwin)$/ then
66 puts "We have no plan to Buld OS \"#{option[:os]}\" \n please check your option OS "
76 BuildServerController.create_server( option[:name], Utils::WORKING_DIR, option[:url], option[:domain], option[:pid] )
78 BuildServerController.remove_server( option[:name] )
80 BuildServerController.start_server( option[:name], option[:port] )
82 BuildServerController.stop_server( option[:name] )
84 BuildServerController.add_friend_server( option[:name], option[:domain], option[:port] )
86 raise RuntimeError, "input option incorrect : #{option[:cmd]}"