diff --git a/kiwi_scp/scripts/kiwi.py b/kiwi_scp/scripts/kiwi.py index 6f96b5d..ac9dc9e 100644 --- a/kiwi_scp/scripts/kiwi.py +++ b/kiwi_scp/scripts/kiwi.py @@ -18,7 +18,7 @@ def main(verbose: int) -> None: - Manage full instances using just your favorite version control system - Group services into projects, each with their own docker-compose.yml - Build service-specific, private docker images from Dockerfiles - - Make use of the local file system by referring to ${TARGETDIR}, ${TARGETROOT} and ${CONFIGDIR} in compose files + - Make use of the local file system by referring to ${KIWI_PROJECT}, ${KIWI_INSTANCE} and ${KIWI_CONFIG} in compose files - Create your own instance-global variables for compose files using the kiwi.yml "environment" section """ diff --git a/kiwi_scp/service.py b/kiwi_scp/service.py index 220aa63..893f387 100644 --- a/kiwi_scp/service.py +++ b/kiwi_scp/service.py @@ -22,7 +22,7 @@ class Service: content: CommentedMap = attr.ib() parent_project: "Project" = attr.ib() - _RE_CONFIGDIR = re.compile(r"^\s*\$(?:CONFIGDIR|{CONFIGDIR})/+(.*)$", flags=re.UNICODE) + _RE_KIWI_CONFIG = re.compile(r"^\s*\$(?:KIWI_CONFIG|{KIWI_CONFIG})/+(.*)$", flags=re.UNICODE) @property def configs(self) -> Generator[Path, None, None]: @@ -31,7 +31,7 @@ class Service: for volume in self.content["volumes"]: host_part = volume.split(":")[0] - cd_match = Service._RE_CONFIGDIR.match(host_part) + cd_match = Service._RE_KIWI_CONFIG.match(host_part) if cd_match: yield Path(cd_match.group(1)) diff --git a/tests/test_service.py b/tests/test_service.py index 064edad..d172f06 100644 --- a/tests/test_service.py +++ b/tests/test_service.py @@ -35,8 +35,8 @@ class TestDefault: "image": "repo/image:tag", "volumes": [ "docker_volume/third/dir:/path/to/third/mountpoint", - "${TARGETDIR}/some/dir:/path/to/some/mountpoint", - "$TARGETDIR/other/dir:/path/to/other/mountpoint", + "${KIWI_PROJECT}/some/dir:/path/to/some/mountpoint", + "$KIWI_PROJECT/other/dir:/path/to/other/mountpoint", ] }), parent_project=None, @@ -51,8 +51,8 @@ class TestDefault: content=CommentedMap({ "image": "repo/image:tag", "volumes": [ - "${CONFIGDIR}/some/config:/path/to/some/config", - "$CONFIGDIR/other/config:/path/to/other/config", + "${KIWI_CONFIG}/some/config:/path/to/some/config", + "$KIWI_CONFIG/other/config:/path/to/other/config", ] }), parent_project=None,