diff --git a/scripts/run.ps1 b/scripts/run.ps1 index 18c009e0f9..30980c1971 100644 --- a/scripts/run.ps1 +++ b/scripts/run.ps1 @@ -60,31 +60,27 @@ function Install() { } function Docker-Compose-Up { - if (Test-Path -Path "${dockerDir}\docker-compose.override.yml" -PathType leaf) { - docker-compose -f ${dockerDir}\docker-compose.yml -f ${dockerDir}\docker-compose.override.yml up -d - } - else { - docker-compose -f ${dockerDir}\docker-compose.yml up -d - } + Docker-Compose-Files + docker-compose up -d } function Docker-Compose-Down { - if (Test-Path -Path "${dockerDir}\docker-compose.override.yml" -PathType leaf) { - docker-compose -f ${dockerDir}\docker-compose.yml -f ${dockerDir}\docker-compose.override.yml down - } - else { - docker-compose -f ${dockerDir}\docker-compose.yml down - } + Docker-Compose-Files + docker-compose down } function Docker-Compose-Pull { + Docker-Compose-Files + docker-compose pull +} + +function Docker-Compose-Files { if (Test-Path -Path "${dockerDir}\docker-compose.override.yml" -PathType leaf) { - docker-compose -f ${dockerDir}\docker-compose.yml -f ${dockerDir}\docker-compose.override.yml pull + $env:COMPOSE_FILE = "${dockerDir}\docker-compose.yml;${dockerDir}\docker-compose.override.yml" } else { - docker-compose -f ${dockerDir}\docker-compose.yml pull + $env:COMPOSE_FILE = "${dockerDir}\docker-compose.yml" } - } function Docker-Prune { diff --git a/scripts/run.sh b/scripts/run.sh index a5fa37e20c..8188955264 100644 --- a/scripts/run.sh +++ b/scripts/run.sh @@ -103,29 +103,26 @@ function install() { } function dockerComposeUp() { - if [ -f "${DOCKER_DIR}/docker-compose.override.yml" ] - then - docker-compose -f $DOCKER_DIR/docker-compose.yml -f $DOCKER_DIR/docker-compose.override.yml up -d - else - docker-compose -f $DOCKER_DIR/docker-compose.yml up -d - fi + dockerComposeFiles + docker-compose up -d } function dockerComposeDown() { - if [ -f "${DOCKER_DIR}/docker-compose.override.yml" ] - then - docker-compose -f $DOCKER_DIR/docker-compose.yml -f $DOCKER_DIR/docker-compose.override.yml down - else - docker-compose -f $DOCKER_DIR/docker-compose.yml down - fi + dockerComposeFiles + docker-compose down } function dockerComposePull() { + dockerComposeFiles + docker-compose pull +} + +function dockerComposeFiles() { if [ -f "${DOCKER_DIR}/docker-compose.override.yml" ] then - docker-compose -f $DOCKER_DIR/docker-compose.yml -f $DOCKER_DIR/docker-compose.override.yml pull + export COMPOSE_FILE="$DOCKER_DIR/docker-compose.yml:$DOCKER_DIR/docker-compose.override.yml" else - docker-compose -f $DOCKER_DIR/docker-compose.yml pull + export COMPOSE_FILE="$DOCKER_DIR/docker-compose.yml" fi }