Added build info
This commit is contained in:
@@ -61,7 +61,6 @@ class DBase
|
||||
end
|
||||
|
||||
def get_recips()
|
||||
result = []
|
||||
Recips.order(:id).map do |item|
|
||||
{ :fname => item[:filepath], :descr => item[:descr], :id => item[:id] }
|
||||
end
|
||||
@@ -306,4 +305,25 @@ class DBase
|
||||
nil
|
||||
end
|
||||
end
|
||||
|
||||
def get_builds()
|
||||
$DDB["select t1.id as buildid, t1.create_at as createat, t1.result as state, t2.reponame as reponame, t2.id as gitid, t3.id as projid, t3.projname as prjname, count(*) as pkgcnt from buildtask as t1 join repos as t2 on t1.repo_id = t2.id join projects as t3 on t1.proj_id = t3.id join build_rpm as t4 on t4.build_id = t1.id group by buildid, createat, state, reponame, projid, prjname, gitid order by t1.id"].all
|
||||
end
|
||||
|
||||
def get_build_info(build_id)
|
||||
BuildTask[build_id.to_i]
|
||||
end
|
||||
|
||||
def get_rpms_for_build(build_id)
|
||||
bld_info = BuildRpms.where(build_id: build_id.to_i)
|
||||
bld_info.map do |item|
|
||||
result = Rpms[item[:rpm_id]]
|
||||
result[:fname] = File.basename(result[:savepath])
|
||||
result
|
||||
end
|
||||
end
|
||||
|
||||
def get_rpms()
|
||||
Rpms.order(:id).all
|
||||
end
|
||||
end
|
||||
|
||||
@@ -46,3 +46,7 @@ end
|
||||
def get_rpm_paths(directory)
|
||||
Dir.glob(File.join(directory, "**", "*")).reject { |f| File.directory?(f) }.select { |f| File.extname(f) == ".rpm" }.map { |f| f.delete_prefix(directory + "/") }
|
||||
end
|
||||
|
||||
def get_log_paths_success(directory)
|
||||
Dir.glob(File.join(directory, "**", "*")).reject { |f| File.directory?(f) }.select { |f| File.extname(f) == ".log" }.reject { |f| File.basename(f) == "process.log" }
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user