toaster: add 'nobuild' option to Toaster
PATCH 1/1 toaster: add 'nobuild' option to Toaster
From: David Reyna <[email protected]>
Add a 'nobuild' option for starting Toaster without the project and hosted builds support. This allows a Toaster host to provide local build statistics without opening the host to external users building projects.
[YOCTO #12315]
--- bitbake/bin/toaster | 14 ++++-- bitbake/lib/toaster/toastergui/templates/base.html | 4 ++ .../lib/toaster/toastergui/templates/landing.html | 2 + bitbake/lib/toaster/toastergui/views.py | 57 +++++++++++++--------- bitbake/lib/toaster/toastergui/widgets.py | 4 ++ 5 files changed, 55 insertions(+), 26 deletions(-)
bitbake/bin/toaster +11 -3
@@ -183,6 +183,7 @@ unset OE_ROOT WEBSERVER=1 +export TOASTER_BUILDSERVER=1 ADDR_PORT="localhost:8000" unset CMD for param in $*; do
@@ -190,6 +191,9 @@ for param in $*; do noweb ) WEBSERVER=0 ;; + nobuild ) + TOASTER_BUILDSERVER=0 + ;; start ) CMD=$param ;;
@@ -286,9 +290,13 @@ case $CMD in return 4 fi export BITBAKE_UI='toasterui' - $MANAGE runbuilds \ - </dev/null >>${BUILDDIR}/toaster_runbuilds.log 2>&1 \ - & echo $! >${BUILDDIR}/.runbuilds.pid + if [ $TOASTER_BUILDSERVER -eq 1 ] ; then + $MANAGE runbuilds \ + </dev/null >>${BUILDDIR}/toaster_runbuilds.log 2>&1 \ + & echo $! >${BUILDDIR}/.runbuilds.pid + else + echo "Toaster build server not started." + fi # set fail safe stop system on terminal exit trap stop_system SIGHUP
bitbake/lib/toaster/toastergui/templates/base.html +4 -0
@@ -110,6 +110,7 @@ All builds </a> </li> + {% if project_enable %} <li id="navbar-all-projects" {% if request.resolver_match.url_name == 'all-projects' %} class="active"
@@ -119,6 +120,7 @@ All projects </a> </li> + {% endif %} {% endif %} <li id="navbar-docs"> <a target="_blank" href="http://www.yoctoproject.org/docs/latest/toaster-manual/toaster-manual.html">
@@ -127,7 +129,9 @@ </a> </li> </ul> + {% if project_enable %} <a class="btn btn-default navbar-btn navbar-right" id="new-project-button" href="{% url 'newproject' %}">New project</a> + {% endif %} </div> </div> </nav>
bitbake/lib/toaster/toastergui/templates/landing.html +2 -0
@@ -21,11 +21,13 @@ </p> {% if lvs_nos %} + {% if project_enable %} <p class="top-air"> <a class="btn btn-primary btn-lg" href="{% url 'newproject' %}"> Create your first Toaster project to run manage builds </a> </p> + {% endif %} {% else %} <div class="alert alert-info lead top-air"> Toaster has no layer information. Without layer information, you cannot run builds. To generate layer information you can:
bitbake/lib/toaster/toastergui/views.py +34 -23
206 lines not on this page · raw message
bitbake/lib/toaster/toastergui/widgets.py +4 -0
@@ -41,6 +41,7 @@ import types import json import collections import re +import os from toastergui.tablefilter import TableFilterMap
@@ -86,6 +87,9 @@ class ToasterTable(TemplateView): context['table_name'] = type(self).__name__.lower() context['empty_state'] = self.empty_state + # global variables + context['project_enable'] = ('1' == os.environ.get('TOASTER_BUILDSERVER')) + return context def get(self, request, *args, **kwargs):
Signature · 1 line
1.9.1