6
0
mirror of https://github.com/ChristianLight/tutor.git synced 2024-12-12 14:17:46 +00:00

Add local exec command

This commit is contained in:
Régis Behmo 2019-05-05 12:22:14 +02:00 committed by Régis Behmo
parent 6196defa8b
commit 4f9bb7d752
2 changed files with 18 additions and 0 deletions

View File

@ -2,6 +2,7 @@
## Latest
- [Improvement] Add `local exec` command for running commands inside existing containers
- [Bugfix] Fix triple display of courses in LMS search (upstream patch, #189)
## 3.3.8 (2019-04-28)

View File

@ -129,6 +129,22 @@ def run(root, service, command, args):
docker_compose(root, config, *run_command)
@click.command(
help="Exec a command in a running container",
context_settings={"ignore_unknown_options": True},
)
@opts.root
@click.argument("service")
@click.argument("command")
@click.argument("args", nargs=-1, required=False)
def execute(root, service, command, args):
exec_command = ["exec", service, command]
if args:
exec_command += args
config = tutor_config.load(root)
docker_compose(root, config, *exec_command)
@click.command(help="Create databases and run database migrations")
@opts.root
def databases(root):
@ -353,6 +369,7 @@ local.add_command(start)
local.add_command(stop)
local.add_command(restart)
local.add_command(run)
local.add_command(execute, name="exec")
local.add_command(databases)
local.add_command(https)
local.add_command(logs)