From edf6b560167f2ad0b63f17ff402de65d3760f5f9 Mon Sep 17 00:00:00 2001 From: d11wtq Date: Sat, 7 Jun 2014 08:22:54 +0000 Subject: [PATCH] Spike: Add --up option to `fig run` Signed-off-by: Chris Corbyn --- fig/cli/main.py | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/fig/cli/main.py b/fig/cli/main.py index f58986458..1e2ea90fc 100644 --- a/fig/cli/main.py +++ b/fig/cli/main.py @@ -202,9 +202,10 @@ class TopLevelCommand(Command): $ fig run web python manage.py shell - Note that this will not start any services that the command's service - links to. So if, for example, your one-off command talks to your - database, you will need to run `fig up -d db` first. + Note that by default this will not start any services that the + command's service links to. So if, for example, your one-off command + talks to your database, you will need to either run `fig up -d db` + first, or use `fig run --up SERVICE COMMAND [ARGS...]`. Usage: run [options] SERVICE COMMAND [ARGS...] @@ -214,7 +215,13 @@ class TopLevelCommand(Command): -T Disable pseudo-tty allocation. By default `fig run` allocates a TTY. --rm Remove container after run. Ignored in detached mode. + --up Also start services that the command's service links to """ + + if options['--up']: + # FIXME: I'm not sure if this is good python form + self.up({'-d': True, 'SERVICE': None}) + service = self.project.get_service(options['SERVICE']) tty = True