mock build
This commit is contained in:
@@ -27,6 +27,12 @@ end
|
||||
class BuildTask < Sequel::Model(:buildtask)
|
||||
end
|
||||
|
||||
class Rpms < Sequel::Model(:rpms)
|
||||
end
|
||||
|
||||
class BuildRpms < Sequel::Model(:build_rpm)
|
||||
end
|
||||
|
||||
class DBase
|
||||
attr :error, :last_id, :cfg
|
||||
|
||||
@@ -34,7 +40,7 @@ class DBase
|
||||
@cfg = cfg
|
||||
end
|
||||
|
||||
def creategit(project_name, description, cfg)
|
||||
def creategit(project_name, description)
|
||||
@error = nil
|
||||
data = Repos.where(reponame: project_name).first
|
||||
if data.nil?
|
||||
@@ -228,7 +234,7 @@ class DBase
|
||||
def create_build_task(prj_id, git_id, proj_path)
|
||||
id = BuildTask.insert(repo_id: git_id.to_i, proj_id: prj_id.to_i, signpath: "", logpath: "", errlogpath: "", result: 0)
|
||||
@last_id = id
|
||||
BuildTask.where(id: id).update(logpath: File.join(proj_path, "#{id}"))
|
||||
BuildTask.where(id: id).update(logpath: File.join(proj_path, "#{id}"), errlogpath: File.join(proj_path, "#{id}", "process.log"))
|
||||
end
|
||||
|
||||
def update_build_task_status(build_id, status)
|
||||
@@ -250,4 +256,10 @@ class DBase
|
||||
def after_fork()
|
||||
Sequel.connect(@cfg.get_db)
|
||||
end
|
||||
|
||||
def save_rpm(build_id, path_to_rpm, rpm_name, git_id)
|
||||
id = Rpms.insert(savepath: path_to_rpm, rpmname: rpm_name, sign: 0, signpath: "", repo_id: git_id.to_i)
|
||||
@last_id = id
|
||||
BuildRpms.insert(build_id: build_id.to_i, rpm_id: id)
|
||||
end
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user