case attr
when "GIT_BIN_PATH"
server.git_bin_path = value
+ when "MAX_WORKING_JOBS"
+ server.jobmgr.max_working_jobs = value.to_i
+ when "JOB_LOG_URL"
+ server.job_log_url = value
+ when "SEND_MAIL"
+ server.send_mail = value
when "TEST_TIME"
server.test_time = value.to_i
when "PASSWORD"
server.password = value
+ when "JOB_KEEP_TIME"
+ server.keep_time = value.to_i
when "FTP_ADDR"
server.ftp_addr = value
when "FTP_PORT"
server.ftp_username = value
when "FTP_PASSWD"
server.ftp_passwd = value
+ when "CHANGELOG_CHECK"
+ server.changelog_check = value
when "DB_DSN"
case value
when /^SQLite3:(.*)/i then
- if $1.strip.empty? then db_dsn = "SQLite3:#{BuildServer::CONFIG_ROOT}/#{@id}/server.db"
+ if $1.strip.empty? then db_dsn = "SQLite3:#{BuildServer::CONFIG_ROOT}/#{id}/server.db"
else db_dsn = "SQLite3:#{$1.strip}"
end
when /^Mysql:(.*)/i then
db_dsn = "Mysql:#{$1}"
else
- db_dsn = "SQLite3:#{BuildServer::CONFIG_ROOT}/#{@id}/server.db"
+ db_dsn = "SQLite3:#{BuildServer::CONFIG_ROOT}/#{id}/server.db"
end
server.db_dsn = db_dsn
when "DB_USER"
public
def set_parent_job( parent )
@parent = parent
+
+ if not parent.nil? then
+ @server.get_db_connection() do |db|
+ db.do "UPDATE jobs SET parent_job_id = #{parent.id} WHERE id = #{@id}"
+ end
+ end
end
source_id = @project.get_source_id_from_ver(pkginfo.get_version(),db)
db.do "UPDATE jobs SET source_id=#{source_id} WHERE id=#{@id}"
end
- db.do "UPDATE jobs SET status='#{@status}',remote_build_server_id=#{remote_bs_id}
- WHERE id=#{@id}"
+ db.do "UPDATE jobs SET status='#{@status}',remote_build_server_id=#{remote_bs_id} WHERE id=#{@id}"
if @status == "FINISHED" or @status == "ERROR" or @status == "CANCELED" then
@end_time = Time.now.strftime("%F %T")
db.do "UPDATE jobs SET end_time=#{now} WHERE id=#{@id}"
raise "Unsupported OS name is used!"
end
end
+
+ # check user email
+ user_id = @parent_server.check_user_id_from_email( user_email )
+ if user_id == -1 then
+ BuildCommServer.send_begin(req)
+ req.puts "Error: Cannot find the user with \"#{user_email}\"!"
+ BuildCommServer.send_end(req)
+ raise "No user information!"
+ end
+
# multi build job
if project_name_list.count > 1 or os_list.count > 1 then
new_job_list = []
if new_job.nil? then
@log.warn "\"#{pname}\" does not support #{os}"
next
+ else
+ new_job.user_id = user_id
end
new_job_list.push new_job
@log.info "Received a request for building this project : #{pname}, #{os}"
if new_job_list.count > 1 then
new_job = @parent_server.prjmgr.create_new_multi_build_job( new_job_list )
+ if new_job.nil? then
+ raise "Multi-Build Job creation failed!"
+ else
+ new_job.user_id = user_id
+ end
elsif new_job_list.count == 1 then
new_job = new_job_list[0]
else
os = os_list[0]
new_job = create_new_internal_job(git_repos, os, git_commit, pkg_files, dock_num, dist_name )
+ if new_job.nil? then
+ raise "Internal-Build Job creation failed!"
+ else
+ new_job.user_id = user_id
+ end
if rev_job then new_job.set_rev_build_check_job(nil) end
# single job
check_build_project(pname,passwd,dist_name,req)
new_job = create_new_job( pname, os, dist_name )
+ if new_job.nil? then
+ raise "\"#{pname}\" does not support #{os} in #{dist_name}"
+ else
+ new_job.user_id = user_id
+ end
else
BuildCommServer.send_begin(req)
req.puts "Error: There is no valid job to build!"
raise "No valid jobs!"
end
- # check user email
- user_id = @parent_server.check_user_id_from_email( user_email )
- if user_id != -1 then
- new_job.user_id = user_id
- else
- BuildCommServer.send_begin(req)
- req.puts "Error: Cannot find the user with \"#{user_email}\"!"
- BuildCommServer.send_end(req)
- raise "No user information!"
- end
-
# check reverse build
if no_reverse then new_job.set_no_reverse end