Skip to content

Commit

Permalink
Fixed compatibility with Mutagen 0.14.0 (#318)
Browse files Browse the repository at this point in the history
* DockerCompose but

* Update mutagen.sh

* Support DockerCompose 2.5.0

* Update mutagen.sh
  • Loading branch information
alexanderM91 committed May 9, 2022
1 parent 3966b3b commit 2b08ee6
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions bin/sdk/mount/mutagen.sh
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ function Mount::Mutagen::beforeUp() {
# The volume will not be deleted if any app container is running.
docker volume rm "${SPRYKER_SYNC_VOLUME}" >/dev/null 2>&1 || true

updateComposeCovertWindowsPaths
terminateMutagenSessionsWithObsoleteDockerId

# Clean content of the sync volume if the sync session is terminated or halted.
Expand All @@ -38,6 +39,16 @@ function Mount::Mutagen::beforeUp() {
fi
}

# https://github.com/docker/compose/issues/9428
function updateComposeCovertWindowsPaths() {
local mutagenInstalledVersion="$(Mount::Mutagen::getInstalledVersion)"
local installedVersion=$(Version::parse ${mutagenInstalledVersion})

if [ "${installedVersion:0:2}" -ge 14 ]; then
export COMPOSE_CONVERT_WINDOWS_PATHS=0
fi
}

function terminateMutagenSessionsWithObsoleteDockerId() {
dockerId=$(docker info --format '{{.ID}}' 2>/dev/null | awk '{ gsub(":","_",$1); print $1 }' || echo '')

Expand Down

0 comments on commit 2b08ee6

Please sign in to comment.