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

Remove Mutagen because file mount combined with Orbstack is fast! #747

Closed
wants to merge 12 commits into from
5 changes: 1 addition & 4 deletions commands/env-init.help
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,7 @@ WARDEN_USAGE=$(cat <<EOF
pre-configured for running Laravel

magento2 Nginx, varnish, php-fpm, db (mariadb), elasticsearch, redis,
and rabbitmq services pre configured for Magento 2; on macOS
systems code files are synced into container using mutagen
session with pub/media, pub/static and var dirs excluded.
On Linux code is mounted natively.
and rabbitmq services pre configured for Magento 2; Code is mounted natively.

magento1 Nginx, php-fpm, db (mariadb), and redis services
pre-configured for running Magento 1
Expand Down
59 changes: 0 additions & 59 deletions commands/env.cmd
Original file line number Diff line number Diff line change
Expand Up @@ -174,66 +174,7 @@ TRAEFIK_ADDRESS="$(docker container inspect traefik \
)"
export TRAEFIK_ADDRESS;

if [[ $OSTYPE =~ ^darwin ]]; then
export MUTAGEN_SYNC_FILE="${WARDEN_DIR}/environments/${WARDEN_ENV_TYPE}/${WARDEN_ENV_TYPE}.mutagen.yml"

if [[ -f "${WARDEN_HOME_DIR}/environments/${WARDEN_ENV_TYPE}/${WARDEN_ENV_TYPE}.mutagen.yml" ]]; then
export MUTAGEN_SYNC_FILE="${WARDEN_HOME_DIR}/environments/${WARDEN_ENV_TYPE}/${WARDEN_ENV_TYPE}.mutagen.yml"
fi

if [[ -f "${WARDEN_ENV_PATH}/.warden/environments/${WARDEN_ENV_TYPE}/${WARDEN_ENV_TYPE}.mutagen.yml" ]]; then
export MUTAGEN_SYNC_FILE="${WARDEN_ENV_PATH}/.warden/environments/${WARDEN_ENV_TYPE}/${WARDEN_ENV_TYPE}.mutagen.yml"
fi

if [[ -f "${WARDEN_ENV_PATH}/.warden/mutagen.yml" ]]; then
export MUTAGEN_SYNC_FILE="${WARDEN_ENV_PATH}/.warden/mutagen.yml"
fi
fi

## pause mutagen sync if needed
if [[ "${WARDEN_PARAMS[0]}" == "stop" ]] \
&& [[ $OSTYPE =~ ^darwin ]] && [[ -f "${MUTAGEN_SYNC_FILE}" ]]
then
$WARDEN_BIN sync pause
fi

## pass orchestration through to docker compose
${DOCKER_COMPOSE_COMMAND} \
--project-directory "${WARDEN_ENV_PATH}" -p "${WARDEN_ENV_NAME}" \
"${DOCKER_COMPOSE_ARGS[@]}" "${WARDEN_PARAMS[@]}" "$@"

## resume mutagen sync if available and php-fpm container id hasn't changed
if { [[ "${WARDEN_PARAMS[0]}" == "up" ]] || [[ "${WARDEN_PARAMS[0]}" == "start" ]]; } \
&& [[ $OSTYPE =~ ^darwin ]] && [[ -f "${MUTAGEN_SYNC_FILE}" ]] \
&& [[ $($WARDEN_BIN sync list | grep -ci 'Status: \[Paused\]' | awk '{print $1}') == "1" ]] \
&& [[ $($WARDEN_BIN env ps -q php-fpm) ]] \
&& [[ $(docker container inspect "$($WARDEN_BIN env ps -q php-fpm)" --format '{{ .State.Status }}') = "running" ]] \
&& [[ $($WARDEN_BIN env ps -q php-fpm) = $($WARDEN_BIN sync list | grep -i 'URL: docker' | awk -F'/' '{print $3}') ]]
then
$WARDEN_BIN sync resume
fi

if [[ $OSTYPE =~ ^darwin ]] && [[ -f "${MUTAGEN_SYNC_FILE}" ]] # If we're using Mutagen
then
MUTAGEN_VERSION=$(mutagen version)
CONNECTION_STATE_STRING='Connected state: Connected'
if [[ $(version "${MUTAGEN_VERSION}") -ge $(version '0.15.0') ]]; then
CONNECTION_STATE_STRING='Connected: Yes'
fi

## start mutagen sync if needed
if { [[ "${WARDEN_PARAMS[0]}" == "up" ]] || [[ "${WARDEN_PARAMS[0]}" == "start" ]]; } \
&& [[ $($WARDEN_BIN sync list | grep -c "${CONNECTION_STATE_STRING}" | awk '{print $1}') != "2" ]] \
&& [[ $($WARDEN_BIN env ps -q php-fpm) ]] \
&& [[ $(docker container inspect "$($WARDEN_BIN env ps -q php-fpm)" --format '{{ .State.Status }}') = "running" ]]
then
$WARDEN_BIN sync start
fi
fi

## stop mutagen sync if needed
if [[ "${WARDEN_PARAMS[0]}" == "down" ]] \
&& [[ $OSTYPE =~ ^darwin ]] && [[ -f "${MUTAGEN_SYNC_FILE}" ]]
then
$WARDEN_BIN sync stop
fi
85 changes: 0 additions & 85 deletions commands/sync.cmd

This file was deleted.

23 changes: 0 additions & 23 deletions commands/sync.help

This file was deleted.

17 changes: 0 additions & 17 deletions environments/drupal/drupal.darwin.yml

This file was deleted.

28 changes: 0 additions & 28 deletions environments/drupal/drupal.mutagen.yml

This file was deleted.

16 changes: 0 additions & 16 deletions environments/magento1/magento1.darwin.yml

This file was deleted.

24 changes: 0 additions & 24 deletions environments/magento1/magento1.mutagen.yml

This file was deleted.

16 changes: 0 additions & 16 deletions environments/magento2/magento2.darwin.yml

This file was deleted.

30 changes: 0 additions & 30 deletions environments/magento2/magento2.mutagen.yml

This file was deleted.

16 changes: 0 additions & 16 deletions environments/shopware/shopware.darwin.yml

This file was deleted.

24 changes: 0 additions & 24 deletions environments/shopware/shopware.mutagen.yml

This file was deleted.