From: "Reyna, David" <david.reyna@windriver.com>
To: <toaster@lists.yoctoproject.org>
Subject: [PATCH] toaster: support environment-safe manage commands
Date: Fri, 27 Mar 2020 13:44:32 -0700 [thread overview]
Message-ID: <20200327204432.31470-1-david.reyna@windriver.com> (raw)
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>
---
bitbake/bin/toaster | 10 +++++++++-
1 file changed, 9 insertions(+), 1 deletion(-)
diff --git a/bitbake/bin/toaster b/bitbake/bin/toaster
index c3472dfee8..dd4cd93581 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()
@@ -180,6 +181,7 @@ WEBSERVER=1
export TOASTER_BUILDSERVER=1
ADDR_PORT="localhost:8000"
TOASTERDIR=`dirname $BUILDDIR`
+MANAGE="python3 $OE_ROOT/bitbake/lib/toaster/manage.py"
unset CMD
for param in $*; do
case $param in
@@ -208,6 +210,9 @@ for param in $*; do
toasterdir=*)
TOASTERDIR="${param#*=}"
;;
+ manage )
+ CMD=$param
+ ;;
--help)
echo "$HELP"
return 0
@@ -306,6 +311,9 @@ case $CMD in
stop_system
echo "Successful ${CMD}."
;;
+ manage )
+ $MANAGE $manage_cmd
+ ;;
esac
custom_extention toaster_postpend $CMD $ADDR_PORT
--
2.20.1
reply other threads:[~2020-03-27 20:45 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20200327204432.31470-1-david.reyna@windriver.com \
--to=david.reyna@windriver.com \
--cc=toaster@lists.yoctoproject.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).