inveniosoftware / invenio-cli

CLI module for Invenio
https://invenio-cli.readthedocs.io
MIT License
10 stars 43 forks source link

Allow usage of different docker-compose files #290

Open fenekku opened 2 years ago

fenekku commented 2 years ago

Is your feature request related to a problem? Please describe.

We use different docker-compose files for stage/production than the ones for development. Because they follow a particular naming convention, invenio-cli commands that implicitly depend on the presence of docker-compose.full.yml fail e.g.,

invenio-cli destroy
Destroying containers, volumes, virtual environment...
Destroying virtual environment
Removing virtualenv (/home/guillaume/dev/work/my-site/.venv)...
Destroying containers...
Failed to destroy instance. You can destroy only services using the services command: invenio-cli services destroy
Errors: .FileNotFoundError: [Errno 2] No such file or directory: './docker-compose.full.yml'

Describe the solution you'd like

I would like to be able to pass a docker-compose file to use on the CLI and/or set it in my local .invenio.private file so that commands work even if I use a diferent file name.

Mimic docker-compose -f option:

invenio-cli -f docker-compose.prod.yml
invenio-cli -f docker-compose.dev.yml

or in config file:

[cli]
project_dir = /home/guillaume/dev/work/my-site
instance_path = /home/guillaume/dev/work/my-site/.venv/var/instance
services_setup = True
compose_filename = docker-compose.dev.yml