diff options
author | Magnus Granberg <zorry@gentoo.org> | 2016-01-07 20:43:13 +0100 |
---|---|---|
committer | Magnus Granberg <zorry@gentoo.org> | 2016-01-07 20:43:13 +0100 |
commit | 8102ca4b451d4744d8ac03ffb4d6b42bb3b26f51 (patch) | |
tree | 9c9ead9a7a9150d8ca9e5c9eecd10a4a2434570f | |
parent | fix new repoman qa to show repoman full (diff) | |
download | tinderbox-cluster-www-8102ca4b451d4744d8ac03ffb4d6b42bb3b26f51.tar.gz tinderbox-cluster-www-8102ca4b451d4744d8ac03ffb4d6b42bb3b26f51.tar.bz2 tinderbox-cluster-www-8102ca4b451d4744d8ac03ffb4d6b42bb3b26f51.zip |
add static dir
-rw-r--r-- | python/tbc_www/models.py | 68 | ||||
-rw-r--r-- | python/tbc_www/urls.py | 1 | ||||
-rw-r--r-- | python/tbc_www/views.py | 32 | ||||
-rw-r--r-- | python/templates/pages/home/index.html | 2 | ||||
-rw-r--r-- | python/templates/pages/new/index.html | 2 | ||||
-rw-r--r-- | static/foo.txt | 0 |
6 files changed, 90 insertions, 15 deletions
diff --git a/python/tbc_www/models.py b/python/tbc_www/models.py index efdc13a..e864cf8 100644 --- a/python/tbc_www/models.py +++ b/python/tbc_www/models.py @@ -47,7 +47,7 @@ class Packages(models.Model): class PackagesMetadata(models.Model): Id = models.IntegerField(primary_key=True, db_column='id') PackageId = models.ForeignKey(Packages, db_column='package_id') - Changlog = models.TextField(db_column='changlog') + Gitlog = models.TextField(db_column='gitlog') Descriptions = models.TextField(db_column='descriptions') class Meta: db_table = 'packages_metadata' @@ -69,7 +69,8 @@ class Ebuilds(models.Model): class EbuildsMetadata(models.Model): Id = models.IntegerField(primary_key=True, db_column='id') EbuildId = models.ForeignKey(Ebuilds, db_column='ebuild_id') - Revision = models.CharField(max_length=30, db_column='revision') + Commit = models.CharField(max_length=30, db_column='commit') + New = models.BooleanField(db_column='new') Descriptions = models.CharField(max_length=200, db_column='descriptions') class Meta: db_table = 'ebuilds_metadata' @@ -127,6 +128,14 @@ class BuildLogsErrors(models.Model): def __str__(self): return '%s %s %s' % (self.Id, self.BuildLogId, self.ErrorId) +class EmergeInfo(models.Model): + EInfoId = models.IntegerField(primary_key=True, db_column='einfo_id') + EmergeInfoText = models.TextField(db_column='emerge_info_text') + class Meta: + db_table = 'emerge_info' + def __str__(self): + return '%s %s %s' % (self.EInfoId, self.Checksum, self.EmergeInfoText) + class Setups(models.Model): SetupId = models.AutoField(primary_key=True, db_column='setup_id') Setup = models.CharField(max_length=100, db_column='setup') @@ -146,6 +155,53 @@ class Configs(models.Model): def __str__(self): return '%s %s %s %s' % (self.ConfigId, self.HostName, self.SetupId, self.DefaultConfig) +class BuildLogsConfig(models.Model): + LogId = models.IntegerField(primary_key=True, db_column='log_id') + BuildLogId = models.ForeignKey(BuildLogs, db_column='build_log_id') + ConfigId = models.ForeignKey(Configs, db_column='config_id') + EInfoId = models.ForeignKey(EmergeInfo, db_column='einfo_id') + LogName = models.CharField(max_length=450, db_column='logname') + TimeStamp = models.DateTimeField(db_column='time_stamp') + class Meta: + db_table = 'build_logs_config' + def __str__(self): + return '%s %s %s %s %s %s' % (self.LogId, self.BuildLogId, self.ConfigId, self.EInfoId, self.LogName, self.TimeStamp) + +class EmergeOptions(models.Model): + EmergeOptionId = models.IntegerField(primary_key=True, db_column='eoption_id') + EOption = models.CharField(max_length=45, db_column='eoption') + class Meta: + db_table = 'emerge_options' + def __str__(self): + return '%s %s' % (self.EmergeOptionId, self.EOption) + +class BuildLogsEmergeOptions(models.Model): + Id = models.IntegerField(primary_key=True, db_column='id') + BuildLogId = models.ForeignKey(BuildLogs, db_column='build_log_id') + EmergeOptionId = models.ForeignKey(EmergeOptions, db_column='eoption_id') + class Meta: + db_table = 'build_logs_emerge_options' + def __str__(self): + return '%s %s %s' % (self.Id, self.BuildLogId, self.EmergeOptionId) + +class Uses(models.Model): + UseId = models.IntegerField(primary_key=True, db_column='use_id') + Flag = models.CharField(max_length=150, db_column='flag') + class Meta: + db_table = 'uses' + def __str__(self): + return '%s %s' % (self.UseId, self.Flag) + +class BuildLogsUse(models.Model): + Id = models.IntegerField(primary_key=True, db_column='id') + BuildLogId = models.ForeignKey(BuildLogs, db_column='build_log_id') + UseId = models.ForeignKey(Uses, db_column='use_id') + Status = models.BooleanField(max_length=15, db_column='status') + class Meta: + db_table = 'build_logs_use' + def __str__(self): + return '%s %s %s' % (self.BuildLogId, self.UseId, self.Status) + class BuildJobs(models.Model): BuildJobId = models.AutoField(primary_key=True, db_column='build_job_id') EbuildId = models.ForeignKey(Ebuilds, db_column='ebuild_id') @@ -160,14 +216,6 @@ class BuildJobs(models.Model): def __str__(self): return '%s %s %s %s %s %s %s %s' % (self.BuildJobId, self.EbuildId, self.SetupId, self.ConfigId, self.Status, self.BuildNow, self.RemoveBin, self.TimeStamp) -class Uses(models.Model): - UseId = models.IntegerField(primary_key=True, db_column='use_id') - Flag = models.CharField(max_length=150, db_column='flag') - class Meta: - db_table = 'uses' - def __str__(self): - return '%s %s' % (self.UseId, self.Flag) - class BuildJobsUse(models.Model): Id = models.IntegerField(primary_key=True, db_column='id') BuildJobId = models.ForeignKey(BuildJobs, db_column='build_job_id') diff --git a/python/tbc_www/urls.py b/python/tbc_www/urls.py index 55fbca9..60f00d4 100644 --- a/python/tbc_www/urls.py +++ b/python/tbc_www/urls.py @@ -6,6 +6,7 @@ urlpatterns = patterns('tbc_www.views', url(r'^categories/(?P<category_id>\d+)/$', 'packages'), url(r'^package/(?P<package_id>\d+)/$', 'ebuilds'), url(r'^ebuild/(?P<ebuild_id>\d+)/$', 'ebuild'), + url(r'^new/logs/$', 'new_logs'), url(r'^new/repomanqa/$', 'new_repomanqa'), url(r'^new/$', 'new_main'), ) diff --git a/python/tbc_www/views.py b/python/tbc_www/views.py index ff9a201..df2af96 100644 --- a/python/tbc_www/views.py +++ b/python/tbc_www/views.py @@ -31,7 +31,7 @@ def home(request): pagerequest = 'home' Lines = 10 TmpDict = default_TmpDict(pagerequest) - TmpDict['EM'] = EbuildsMetadata.objects.filter(Revision = '1.1').order_by('-Id')[:Lines] + TmpDict['EM'] = EbuildsMetadata.objects.filter(New = True).order_by('-Id')[:Lines] alist = [] for BL in BuildLogs.objects.order_by('-TimeStamp')[:Lines]: adict2 = {} @@ -107,7 +107,7 @@ def packages(request, category_id): adict['PackageId'] = PM.PackageId.PackageId adict['Package'] = PM.PackageId.Package adict['Descriptions'] = PM.Descriptions - adict['Changlog'] =PM.Changlog + adict['Commitlog'] =PM.Gitlog try: PackagesRepoman.objects.get(PackageId__PackageId = PM.PackageId.PackageId) except PackagesRepoman.DoesNotExist as e: @@ -153,7 +153,7 @@ def new_main(request): pagerequest = 'new' Lines = 30 TmpDict = default_TmpDict(pagerequest) - TmpDict['EM'] = EbuildsMetadata.objects.filter(Revision = '1.1').order_by('-Id')[:Lines] + TmpDict['EM'] = EbuildsMetadata.objects.filter(New = True).order_by('-Id')[:Lines] alist = [] for BL in BuildLogs.objects.order_by('-TimeStamp')[:Lines]: adict2 = {} @@ -211,3 +211,29 @@ def new_repomanqa(request): TmpDict['QA_tmp'] = BuildLogsQa.objects.order_by('-Id')[:Lines/2] TmpDict['PR_tmp'] = PackagesRepoman.objects.order_by('-Id')[:Lines/2] return render(request, 'pages/' + pagerequest + '/repomanqa/index.html', TmpDict) + +def new_logs(request): + pagerequest = 'new' + Lines = 30 + TmpDict = default_TmpDict(pagerequest) + alist = [] + for BL in BuildLogs.objects.order_by('-TimeStamp')[:Lines]: + adict2 = {} + adict2['BuildLogId'] = BL.BuildLogId + adict2['C'] = BL.EbuildId.PackageId.CategoryId.Category + adict2['P'] = BL.EbuildId.PackageId.Package + adict2['V'] = BL.EbuildId.Version + adict2['R'] = BL.EbuildId.PackageId.RepoId.Repo + adict2['Fail'] = BL.Fail + adict2['SummeryText'] = BL.SummeryText + if BL.Fail: + adict2['BE_tmp'] = BuildLogsErrors.objects.filter(BuildLogId = BL.BuildLogId) + try: + PackagesRepomanInfo = PackagesRepoman.objects.get(PackageId__PackageId = BL.EbuildId.PackageId.PackageId) + except PackagesRepoman.DoesNotExist as e: + adict2['PR'] = False + else: + adict2['PR'] = PackagesRepomanInfo.RepomanText + alist.append(adict2) + TmpDict['BL_tmp'] = alist + return render(request, 'pages/' + pagerequest + '/logs/index.html', TmpDict) diff --git a/python/templates/pages/home/index.html b/python/templates/pages/home/index.html index 9a75c4e..08b4b1d 100644 --- a/python/templates/pages/home/index.html +++ b/python/templates/pages/home/index.html @@ -7,7 +7,7 @@ {% include "includes/frontpage/new_packages" %} </div> <div class="col-xs-12 col-md-6"> - <h2>New Logs <small>more at the <a href="/new_logs/">New Logs</a></small></h2> + <h2>New Logs <small>more at the <a href="/new/logs/">New Logs</a></small></h2> {% include "includes/frontpage/new_logs" %} </div> </div> diff --git a/python/templates/pages/new/index.html b/python/templates/pages/new/index.html index 93cf42f..608b40e 100644 --- a/python/templates/pages/new/index.html +++ b/python/templates/pages/new/index.html @@ -6,7 +6,7 @@ {% include "includes/frontpage/new_packages" %} </div> <div class="col-xs-12 col-md-6"> - <h2>New Logs <small>more at the <a href="/new_logs/">New Logs</a></small></h2> + <h2>New Logs <small>more at the <a href="/new/logs/">New Logs</a></small></h2> {% include "includes/frontpage/new_logs" %} </div> </div> diff --git a/static/foo.txt b/static/foo.txt new file mode 100644 index 0000000..e69de29 --- /dev/null +++ b/static/foo.txt |