Add basic run command
This commit is contained in:
parent
21159b801f
commit
5c5bb9a02f
1 changed files with 10 additions and 0 deletions
|
|
@ -64,6 +64,7 @@ class TopLevelCommand(Command):
|
||||||
|
|
||||||
Commands:
|
Commands:
|
||||||
ps List services and containers
|
ps List services and containers
|
||||||
|
run Run a one-off command
|
||||||
start Start services
|
start Start services
|
||||||
stop Stop services
|
stop Stop services
|
||||||
|
|
||||||
|
|
@ -78,6 +79,15 @@ class TopLevelCommand(Command):
|
||||||
for container in service.containers:
|
for container in service.containers:
|
||||||
print container['Names'][0]
|
print container['Names'][0]
|
||||||
|
|
||||||
|
def run(self, options):
|
||||||
|
"""
|
||||||
|
Run a one-off command.
|
||||||
|
|
||||||
|
Usage: run SERVICE COMMAND [ARGS...]
|
||||||
|
"""
|
||||||
|
service = self.service_collection.get(options['SERVICE'])
|
||||||
|
service.start_container(command=[options['COMMAND']] + options['ARGS'])
|
||||||
|
|
||||||
def start(self, options):
|
def start(self, options):
|
||||||
"""
|
"""
|
||||||
Start all services
|
Start all services
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue