diff --git a/CHANGELOG.md b/CHANGELOG.md index c695018..2ee23e9 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,10 @@ Note: Breaking changes between versions are indicated by "💥". +## Unreleased + +- [Bugfix] Make sure `docker-compose.override.yml` are loaded in dev and local contexts + ## 3.11.1 (2020-01-16) - [Feature] Add `config render` command diff --git a/tutor/commands/dev.py b/tutor/commands/dev.py index 96bd576..3bf47bd 100644 --- a/tutor/commands/dev.py +++ b/tutor/commands/dev.py @@ -1,3 +1,5 @@ +import os + import click from . import compose @@ -10,14 +12,22 @@ from .. import utils class DevContext(Context): @staticmethod def docker_compose(root, config, *command): - return utils.docker_compose( + args = [ "-f", tutor_env.pathjoin(root, "local", "docker-compose.yml"), + ] + override_path = tutor_env.pathjoin(root, "local", "docker-compose.override.yml") + if os.path.exists(override_path): + args += ["-f", override_path] + args += [ "-f", tutor_env.pathjoin(root, "dev", "docker-compose.yml"), - "--project-name", - config["DEV_PROJECT_NAME"], - *command, + ] + override_path = tutor_env.pathjoin(root, "dev", "docker-compose.override.yml") + if os.path.exists(override_path): + args += ["-f", override_path] + return utils.docker_compose( + *args, "--project-name", config["DEV_PROJECT_NAME"], *command, ) diff --git a/tutor/commands/local.py b/tutor/commands/local.py index 04e67d0..39e536b 100644 --- a/tutor/commands/local.py +++ b/tutor/commands/local.py @@ -1,3 +1,4 @@ +import os from textwrap import indent import click @@ -15,9 +16,14 @@ from .. import utils class LocalContext(Context): @staticmethod def docker_compose(root, config, *command): + args = [] + override_path = tutor_env.pathjoin(root, "local", "docker-compose.override.yml") + if os.path.exists(override_path): + args += ["-f", override_path] return utils.docker_compose( "-f", tutor_env.pathjoin(root, "local", "docker-compose.yml"), + *args, "--project-name", config["LOCAL_PROJECT_NAME"], *command