bitbake: toaster: add MANAGE variable
Used MANAGE variable to avoid repeating path to manage.py in many places in toaster script. (Bitbake rev: e8e19168ff43b72a2481771e7a40d9d7c155cfd2) Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com> Signed-off-by: Elliot Smith <elliot.smith@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
This commit is contained in:
parent
563b786d4b
commit
af34920dff
|
@ -57,14 +57,14 @@ webserverStartAll()
|
||||||
retval=0
|
retval=0
|
||||||
# you can always add a superuser later via
|
# you can always add a superuser later via
|
||||||
# ../bitbake/lib/toaster/manage.py createsuperuser --username=<ME>
|
# ../bitbake/lib/toaster/manage.py createsuperuser --username=<ME>
|
||||||
python $BBBASEDIR/lib/toaster/manage.py migrate --noinput || retval=1
|
$MANAGE migrate --noinput || retval=1
|
||||||
|
|
||||||
if [ $retval -eq 1 ]; then
|
if [ $retval -eq 1 ]; then
|
||||||
echo "Failed migrations, aborting system start" 1>&2
|
echo "Failed migrations, aborting system start" 1>&2
|
||||||
return $retval
|
return $retval
|
||||||
fi
|
fi
|
||||||
|
|
||||||
python $BBBASEDIR/lib/toaster/manage.py checksettings --traceback || retval=1
|
$MANAGE checksettings --traceback || retval=1
|
||||||
|
|
||||||
if [ $retval -eq 1 ]; then
|
if [ $retval -eq 1 ]; then
|
||||||
printf "\nError while checking settings; aborting\n"
|
printf "\nError while checking settings; aborting\n"
|
||||||
|
@ -73,7 +73,7 @@ webserverStartAll()
|
||||||
|
|
||||||
echo "Starting webserver..."
|
echo "Starting webserver..."
|
||||||
|
|
||||||
python $BBBASEDIR/lib/toaster/manage.py runserver "0.0.0.0:$WEB_PORT" \
|
$MANAGE runserver "0.0.0.0:$WEB_PORT" \
|
||||||
</dev/null >>${BUILDDIR}/toaster_web.log 2>&1 \
|
</dev/null >>${BUILDDIR}/toaster_web.log 2>&1 \
|
||||||
& echo $! >${BUILDDIR}/.toastermain.pid
|
& echo $! >${BUILDDIR}/.toastermain.pid
|
||||||
|
|
||||||
|
@ -130,7 +130,7 @@ start_bitbake() {
|
||||||
return 1
|
return 1
|
||||||
fi
|
fi
|
||||||
export BBSERVER=0.0.0.0:-1
|
export BBSERVER=0.0.0.0:-1
|
||||||
export DATABASE_URL=`$BBBASEDIR/lib/toaster/manage.py get-dburl`
|
export DATABASE_URL=`$MANAGE get-dburl`
|
||||||
# we start the TOASTERUI only if not inhibited
|
# we start the TOASTERUI only if not inhibited
|
||||||
if [ $NOTOASTERUI -eq 0 ]; then
|
if [ $NOTOASTERUI -eq 0 ]; then
|
||||||
bitbake --observe-only -u toasterui --remote-server=$BBSERVER -t xmlrpc \
|
bitbake --observe-only -u toasterui --remote-server=$BBSERVER -t xmlrpc \
|
||||||
|
@ -184,6 +184,7 @@ else
|
||||||
fi
|
fi
|
||||||
|
|
||||||
BBBASEDIR=`dirname $TOASTER`/..
|
BBBASEDIR=`dirname $TOASTER`/..
|
||||||
|
MANAGE=$BBBASEDIR/lib/toaster/manage.py
|
||||||
OEROOT=`dirname $TOASTER`/../..
|
OEROOT=`dirname $TOASTER`/../..
|
||||||
NOTOASTERUI=0
|
NOTOASTERUI=0
|
||||||
WEBSERVER=1
|
WEBSERVER=1
|
||||||
|
@ -316,7 +317,7 @@ echo "The system will $CMD."
|
||||||
|
|
||||||
# check if addr:port is not in use
|
# check if addr:port is not in use
|
||||||
if [ "$CMD" == 'start' ]; then
|
if [ "$CMD" == 'start' ]; then
|
||||||
python $BBBASEDIR/lib/toaster/manage.py checksocket "0.0.0.0:$WEB_PORT" || return 1
|
$MANAGE checksocket "0.0.0.0:$WEB_PORT" || return 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Make sure it's safe to run by checking bitbake lock
|
# Make sure it's safe to run by checking bitbake lock
|
||||||
|
@ -351,7 +352,7 @@ case $CMD in
|
||||||
fi
|
fi
|
||||||
start_bitbake
|
start_bitbake
|
||||||
if [ $? -eq 0 ]; then
|
if [ $? -eq 0 ]; then
|
||||||
python $BBBASEDIR/lib/toaster/manage.py runbuilds & echo $! >${BUILDDIR}/.runbuilds.pid
|
$MANAGE runbuilds & echo $! >${BUILDDIR}/.runbuilds.pid
|
||||||
# set fail safe stop system on terminal exit
|
# set fail safe stop system on terminal exit
|
||||||
trap stop_system SIGHUP
|
trap stop_system SIGHUP
|
||||||
echo "Successful ${CMD}."
|
echo "Successful ${CMD}."
|
||||||
|
|
Loading…
Reference in New Issue