summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorReyna, David <david.reyna@windriver.com>2020-03-27 15:51:00 -0700
committerRichard Purdie <richard.purdie@linuxfoundation.org>2020-03-29 20:02:12 +0100
commitfd844e55bb885a51fe5ef8da1f625b34e646cf5f (patch)
treedfe1f66c4b058a2ef351b37f6f62aea20c8f22a6
parent387fcfb3ffe573715a1997d729237a49cc889e1b (diff)
downloadbitbake-fd844e55bb885a51fe5ef8da1f625b34e646cf5f.tar.gz
toaster: support environment-safe manage commands
Directly support the various 'manage' commands from the Toaster executable, so that users do not have to manually set up the required environment and paths. Examples: $ . toaster manage createsuperuser $ . toaster manage lsupdates [YOCTO #13170] Signed-off-by: David Reyna <David.Reyna@windriver.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
-rwxr-xr-xbin/toaster19
1 files changed, 16 insertions, 3 deletions
diff --git a/bin/toaster b/bin/toaster
index c3472dfee..6b90ee187 100755
--- a/bin/toaster
+++ b/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()
@@ -208,13 +209,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
@@ -306,6 +315,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