Edit docker-compose file of a service
This commit is contained in:
parent
9591395aa4
commit
3097807b05
|
@ -32,6 +32,14 @@ def complete_service_name(ctx, param, incomplete):
|
||||||
return [k for k in services.find_services(Path(config.root_directory)) if k.startswith(incomplete)]
|
return [k for k in services.find_services(Path(config.root_directory)) if k.startswith(incomplete)]
|
||||||
|
|
||||||
|
|
||||||
|
@click.command()
|
||||||
|
@click.argument("service", nargs=1, shell_complete=complete_service_name)
|
||||||
|
@click.pass_context
|
||||||
|
def edit(ctx, service):
|
||||||
|
compose_file = services.get_compose_file(Path(ctx.obj["CONFIG"].root_directory) / service)
|
||||||
|
click.edit(filename=Path(compose_file))
|
||||||
|
|
||||||
|
|
||||||
@click.command()
|
@click.command()
|
||||||
@click.pass_context
|
@click.pass_context
|
||||||
@click.argument("service", nargs=1, shell_complete=complete_service_name)
|
@click.argument("service", nargs=1, shell_complete=complete_service_name)
|
||||||
|
@ -42,4 +50,5 @@ def control(ctx, service, command):
|
||||||
|
|
||||||
|
|
||||||
main.add_command(list)
|
main.add_command(list)
|
||||||
|
main.add_command(edit)
|
||||||
main.add_command(control)
|
main.add_command(control)
|
||||||
|
|
Loading…
Reference in New Issue