Get the gitref from rida.py to ridad.py.

This commit is contained in:
Ralph Bean
2016-07-17 00:10:23 -04:00
parent 4cc3e1271a
commit 7d77463124
2 changed files with 7 additions and 1 deletions

View File

@@ -135,7 +135,12 @@ def submit_build():
return failure("Failed to get the latest commit: %s" % pkgname, 422)
if not rida.scm.SCM(pkg["repository"] + "?#" + pkg["commit"]).is_available():
return failure("Cannot checkout %s" % pkgname, 422)
build = rida.database.ComponentBuild(module_id=module.id, package=pkgname, format="rpms")
build = rida.database.ComponentBuild(
module_id=module.id,
package=pkgname,
format="rpms",
gitref=pkg["commit"], # TODO - re-evaluate this w.r.t. supported branches
)
db.session.add(build)
module.modulemd = mmd.dumps()
module.transition(conf, rida.database.BUILD_STATES["wait"])

View File

@@ -226,6 +226,7 @@ class ComponentBuild(Base):
__tablename__ = "component_builds"
id = Column(Integer, primary_key=True)
package = Column(String, nullable=False)
gitref = Column(String, nullable=False)
# XXX: Consider making this a proper ENUM
format = Column(String, nullable=False)
build_id = Column(Integer) # This is the id of the build in koji