Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support Windows for development setup only #238

Draft
wants to merge 3 commits into
base: master
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
15 changes: 15 additions & 0 deletions admin/configure
Original file line number Diff line number Diff line change
Expand Up @@ -204,6 +204,21 @@ case "$1" in
# Write to .env
touch .env
sed -i.bak -e '/^COMPOSE_FILE=/d' .env && rm -f .env.bak
if [[ $OS == Windows_NT ]]
then
# Optional but convenient to copy/paste paths from file explorer
# https://docs.docker.com/compose/reference/envvars/#compose_convert_windows_paths
if ! grep -q '^COMPOSE_CONVERT_WINDOWS_PATHS=' "$MB_DOCKER_ROOT/.env"
then
echo 'COMPOSE_CONVERT_WINDOWS_PATHS=1' >> .env
fi
# Mandatory to keep this script working
# https://docs.docker.com/compose/reference/envvars/#compose_path_separator
if ! grep -q '^COMPOSE_PATH_SEPARATOR=:$' "$MB_DOCKER_ROOT/.env"
then
echo 'COMPOSE_PATH_SEPARATOR=:' >> .env
fi
fi
echo "COMPOSE_FILE=$(IFS=:; echo "${compose_files[*]}")" >> .env
echo "Successfully set/updated COMPOSE_FILE in '$MB_DOCKER_ROOT/.env'."
exit 0 # EX_OK
Expand Down
26 changes: 20 additions & 6 deletions admin/lib/common.inc.bash
Original file line number Diff line number Diff line change
Expand Up @@ -35,9 +35,16 @@ then
fi
;;
*)
echo >&2 "$SCRIPT_NAME: cannot detect platform to set docker command"
echo >&2 "Try setting the variable \$DOCKER_CMD appropriately"
exit 71 # EX_OSERR
case "$OS" in
Windows_NT)
DOCKER_CMD='docker'
;;
*)
echo >&2 "$SCRIPT_NAME: cannot detect platform to set docker command"
echo >&2 "Try setting the variable \$DOCKER_CMD appropriately"
exit 71 # EX_OSERR
;;
esac
;;
esac
fi
Expand All @@ -63,9 +70,16 @@ then
fi
;;
*)
echo >&2 "$SCRIPT_NAME: cannot detect platform to set docker-compose command"
echo >&2 "Try setting the variable \$DOCKER_COMPOSE_CMD appropriately"
exit 71 # EX_OSERR
case "$OS" in
Windows_NT)
DOCKER_COMPOSE_CMD='docker-compose'
;;
*)
echo >&2 "$SCRIPT_NAME: cannot detect platform to set docker-compose command"
echo >&2 "Try setting the variable \$DOCKER_COMPOSE_CMD appropriately"
exit 71 # EX_OSERR
;;
esac
;;
esac
fi
Expand Down