diff --git a/wodoo/consts.py b/wodoo/consts.py index d841df3f..9eace1d2 100644 --- a/wodoo/consts.py +++ b/wodoo/consts.py @@ -1,11 +1,17 @@ from pathlib import Path from .tools import _search_path +DOCKER_PROFILES = ['manual', 'auto'] VERSIONS = [7.0, 8.0, 9.0, 10.0, 11.0, 12.0, 13.0, 14.0, 15.0, 16.0, 17.0, 18.0] YAML_VERSION = '3.7' DEFAULT_IMAGES_REPO = "https://github.com/marcwimmer/wodoo-images" IMAGES_REPO_BRANCH = "2025-01" +def resolve_profiles(profile): + if profile == "all": + return DOCKER_PROFILES + return profile.split(",") + default_dirs = { 'admin': 'admin', 'odoo_home': '', diff --git a/wodoo/lib_control_with_docker.py b/wodoo/lib_control_with_docker.py index 4bf4978b..b9176855 100644 --- a/wodoo/lib_control_with_docker.py +++ b/wodoo/lib_control_with_docker.py @@ -175,8 +175,9 @@ def recreate(ctx, config, machines=[]): __dc(config, ["up", "--no-start", "--force-recreate"] + machines) -def up(ctx, config, machines=[], daemon=False, remove_orphans=True, profile="auto"): +def up(ctx, config, machines=[], daemon=False, remove_orphans=True, profile="all"): machines = list(machines) + from .consts import resolve_profiles options = [ # '--remove-orphans', # lost data with that; postgres volume suddenly new after rm? @@ -187,12 +188,11 @@ def up(ctx, config, machines=[], daemon=False, remove_orphans=True, profile="aut if remove_orphans: options += ["--remove-orphans"] dc_options = [] - if profile: - dc_options += ["--profile", profile] - if not machines and config.run_postgres and daemon and config.USE_DOCKER: _start_postgres_before(config) - __dc(config, dc_options + ["up"] + options + machines) + for profile in resolve_profiles(profile): + dc_options2 = dc_options + ["--profile", profile] + __dc(config, dc_options2 + ["up"] + options + machines) def down(ctx, config, machines=[], volumes=False, remove_orphans=True):