diff options
Diffstat (limited to 'bitbake/bin/toaster')
-rwxr-xr-x | bitbake/bin/toaster | 37 |
1 files changed, 29 insertions, 8 deletions
diff --git a/bitbake/bin/toaster b/bitbake/bin/toaster index c3472dfee8..f002c8c159 100755 --- a/bitbake/bin/toaster +++ b/bitbake/bin/toaster @@ -8,12 +8,13 @@ # HELP=" -Usage: source toaster start|stop [webport=<address:port>] [noweb] [nobuild] [toasterdir] +Usage 1: source toaster start|stop [webport=<address:port>] [noweb] [nobuild] [toasterdir] Optional arguments: [nobuild] Setup the environment for capturing builds with toaster but disable managed builds [noweb] Setup the environment for capturing builds with toaster but don't start the web server [webport] Set the development server (default: localhost:8000) [toasterdir] Set absolute path to be used as TOASTER_DIR (default: BUILDDIR/../) +Usage 2: source toaster manage [createsuperuser|lsupdates|migrate|makemigrations|checksettings|collectstatic|...] " custom_extention() @@ -32,7 +33,7 @@ databaseCheck() $MANAGE migrate --noinput || retval=1 if [ $retval -eq 1 ]; then - echo "Failed migrations, aborting system start" 1>&2 + echo "Failed migrations, halting system start" 1>&2 return $retval fi # Make sure that checksettings can pick up any value for TEMPLATECONF @@ -40,7 +41,7 @@ databaseCheck() $MANAGE checksettings --traceback || retval=1 if [ $retval -eq 1 ]; then - printf "\nError while checking settings; aborting\n" + printf "\nError while checking settings; exiting\n" return $retval fi @@ -83,7 +84,7 @@ webserverStartAll() echo "Starting webserver..." $MANAGE runserver --noreload "$ADDR_PORT" \ - </dev/null >>${BUILDDIR}/toaster_web.log 2>&1 \ + </dev/null >>${TOASTER_LOGS_DIR}/web.log 2>&1 \ & echo $! >${BUILDDIR}/.toastermain.pid sleep 1 @@ -180,6 +181,14 @@ WEBSERVER=1 export TOASTER_BUILDSERVER=1 ADDR_PORT="localhost:8000" TOASTERDIR=`dirname $BUILDDIR` +# ${BUILDDIR}/toaster_logs/ became the default location for toaster logs +# This is needed for implemented django-log-viewer: https://pypi.org/project/django-log-viewer/ +# If the directory does not exist, create it. +TOASTER_LOGS_DIR="${BUILDDIR}/toaster_logs/" +if [ ! -d $TOASTER_LOGS_DIR ] +then + mkdir $TOASTER_LOGS_DIR +fi unset CMD for param in $*; do case $param in @@ -208,13 +217,21 @@ for param in $*; do toasterdir=*) TOASTERDIR="${param#*=}" ;; + manage ) + CMD=$param + manage_cmd="" + ;; --help) echo "$HELP" return 0 ;; *) - echo "$HELP" - return 1 + if [ "manage" == "$CMD" ] ; then + manage_cmd="$manage_cmd $param" + else + echo "$HELP" + exit 1 + fi ;; esac @@ -239,7 +256,7 @@ fi # 3) the sqlite db if that is being used. # 4) pid's we need to clean up on exit/shutdown export TOASTER_DIR=$TOASTERDIR -export BB_ENV_EXTRAWHITE="$BB_ENV_EXTRAWHITE TOASTER_DIR" +export BB_ENV_PASSTHROUGH_ADDITIONS="$BB_ENV_PASSTHROUGH_ADDITIONS TOASTER_DIR" # Determine the action. If specified by arguments, fine, if not, toggle it if [ "$CMD" = "start" ] ; then @@ -290,7 +307,7 @@ case $CMD in export BITBAKE_UI='toasterui' if [ $TOASTER_BUILDSERVER -eq 1 ] ; then $MANAGE runbuilds \ - </dev/null >>${BUILDDIR}/toaster_runbuilds.log 2>&1 \ + </dev/null >>${TOASTER_LOGS_DIR}/toaster_runbuilds.log 2>&1 \ & echo $! >${BUILDDIR}/.runbuilds.pid else echo "Toaster build server not started." @@ -306,6 +323,10 @@ case $CMD in stop_system echo "Successful ${CMD}." ;; + manage ) + cd $BBBASEDIR/lib/toaster + $MANAGE $manage_cmd + ;; esac custom_extention toaster_postpend $CMD $ADDR_PORT |