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

Add wsl2 support for warden #213

Merged
merged 4 commits into from
Aug 25, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,10 @@
## UNRELEASED [x.y.z](https://github.com/davidalger/warden/tree/x.y.z) (yyyy-mm-dd)
[All Commits](https://github.com/davidalger/warden/compare/0.9.0..develop)

**Bug Fixes:**

* Fixed bug on WSL2 where Xdebug connect back host was improperly set ([#213](https://github.com/davidalger/warden/pull/213) by @iihor-sviziev)

## Version [0.9.0](https://github.com/davidalger/warden/tree/0.9.0) (2020-08-06)
[All Commits](https://github.com/davidalger/warden/compare/0.8.2..0.9.0)

Expand Down
2 changes: 1 addition & 1 deletion commands/debug.cmd
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ WARDEN_ENV_DEBUG_CONTAINER=${WARDEN_ENV_DEBUG_CONTAINER:-php-debug}
WARDEN_ENV_DEBUG_HOST=${WARDEN_ENV_DEBUG_HOST:-}

if [[ ${WARDEN_ENV_DEBUG_HOST} == "" ]]; then
if [[ $OSTYPE =~ ^darwin || "$(< /proc/sys/kernel/osrelease)" == *Microsoft ]]; then
if [[ $OSTYPE =~ ^darwin ]] || grep -sqi microsoft /proc/sys/kernel/osrelease; then
WARDEN_ENV_DEBUG_HOST=host.docker.internal
else
WARDEN_ENV_DEBUG_HOST=$(
Expand Down
5 changes: 5 additions & 0 deletions commands/env.cmd
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,11 @@ if [[ ${WARDEN_ENV_TYPE} == "magento2" ]]; then
WARDEN_RABBITMQ=${WARDEN_RABBITMQ:-1}
fi

## WSL1/WSL2 are GNU/Linux env type but still run Docker Desktop
if [[ ${XDEBUG_CONNECT_BACK_HOST} == '' ]] && grep -sqi microsoft /proc/sys/kernel/osrelease; then
export XDEBUG_CONNECT_BACK_HOST=host.docker.internal
fi

## configure docker-compose files
DOCKER_COMPOSE_ARGS=()

Expand Down