1
0
mirror of https://git.yoctoproject.org/poky synced 2026-07-26 07:07:08 +00:00

bitbake: toaster: improved Project models

A layer may live in a subdirectory of a git repository,
so we add a field to track this setting in the Project layers.

We add the Project schedule_build function, which creates
a build request from the current project configuration.

We also fix an import problem with Projects in views.

(Bitbake rev: 1b5835e5d48cbfb7d38e38437c45d161052dfb37)

Signed-off-by: Alexandru DAMIAN <alexandru.damian@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
This commit is contained in:
Alexandru DAMIAN
2014-07-15 13:01:56 +01:00
committed by Richard Purdie
parent 6cfb76fa8b
commit 5aba3d7fcc
5 changed files with 364 additions and 2 deletions
+19 -2
View File
@@ -37,13 +37,13 @@ class ProjectManager(models.Manager):
name = "meta",
giturl = "git://git.yoctoproject.org/poky",
commit = branch,
treepath = "meta")
dirpath = "meta")
ProjectLayer.objects.create(project = prj,
name = "meta-yocto",
giturl = "git://git.yoctoproject.org/poky",
commit = branch,
treepath = "meta-yocto")
dirpath = "meta-yocto")
return prj
@@ -66,6 +66,22 @@ class Project(models.Model):
user_id = models.IntegerField(null = True)
objects = ProjectManager()
def schedule_build(self):
from bldcontrol.models import BuildRequest, BRTarget, BRLayer, BRVariable
br = BuildRequest.objects.create(project = self)
for l in self.projectlayer_set.all():
BRLayer.objects.create(req = br, name = l.name, giturl = l.giturl, commit = l.commit, dirpath = l.dirpath)
for t in self.projecttarget_set.all():
BRTarget.objects.create(req = br, target = t.target, task = t.task)
for v in self.projectvariable_set.all():
BRVariable.objects.create(req = br, name = v.name, value = v.value)
br.state = BuildRequest.REQ_QUEUED
br.save()
return br
class Build(models.Model):
SUCCEEDED = 0
FAILED = 1
@@ -375,6 +391,7 @@ class ProjectLayer(models.Model):
name = models.CharField(max_length = 100)
giturl = models.CharField(max_length = 254)
commit = models.CharField(max_length = 254)
dirpath = models.CharField(max_length = 254)
class Layer(models.Model):
name = models.CharField(max_length=100)