akretion/docky

generate docker-compose.yml file if missing instead of hard failure

Closed this issue · 3 comments

As for now, if you try to run voodoo run on some voodoo v1 or standard buildout repo with no docker-compose.yml file then you get a hard failure:

Traceback (most recent call last):
  File "/usr/local/bin/voodoo", line 9, in <module>
    load_entry_point('voodoo-cli==2.0.2', 'console_scripts', 'voodoo')()
  File "/usr/local/lib/python2.7/dist-packages/voodoo/main.py", line 402, in main
    Voodoo.run()
  File "/usr/local/lib/python2.7/dist-packages/plumbum/cli/application.py", line 485, in run
    inst, retcode = subapp.run(argv, exit = False)
  File "/usr/local/lib/python2.7/dist-packages/plumbum/cli/application.py", line 457, in run
    inst = cls(argv.pop(0))
  File "/usr/local/lib/python2.7/dist-packages/voodoo/main.py", line 194, in __init__
    self.main_service = self._get_main_service()
  File "/usr/local/lib/python2.7/dist-packages/voodoo/main.py", line 183, in _get_main_service
    dc_file = open('docker-compose.yml', 'r')
IOError: [Errno 2] No such file or directory: 'docker-compose

Instead wouldn't it be better to generate docker-compose.yml file with the right default values if missing?

Also eventually instead of bloating the repo with such docker-compose.yml files when they are the standard ones, we could put them as hidden files. Then however we would need to address the case where a non standard docker-compose.yml is provided by the user so it's not shadowed by such a hidden default file.
It's just that I'm a bit annoyed by how many docker compose files appeared in a project folder between voodoo v1 and voodoo v2 given that most of the time these should be useless.

Now the file are generated automatically whatever is a odoo/wagon/rails/loco project

this is great!!