Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/develop' for release 0.1.0-beta5
Browse files Browse the repository at this point in the history
  • Loading branch information
davidalger committed Jun 19, 2019
2 parents 1abc28b + ece1b4b commit 9350f25
Show file tree
Hide file tree
Showing 7 changed files with 28 additions and 11 deletions.
8 changes: 8 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,11 @@
0.1.0-beta5
===============

* Fixed issue with docker-compose exit codes would result in error messages from global trap
* Added auto-install of mutagen where not already present when any sync command is run
* Added support for WARDEN_WEB_ROOT env setting to publish a sub-dir into /var/www/html
* Changed images for php-fpm to use environment type specfic images from davidalger/warden repository

0.1.0-beta4
===============

Expand Down
3 changes: 3 additions & 0 deletions commands/env.cmd
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,9 @@ if (( ${#WARDEN_PARAMS[@]} == 0 )); then
exit 1
fi

## simply allow the return code from docker-compose to bubble up per normal
trap '' ERR

## anything not caught above is simply passed through to docker-compose to orchestrate
docker-compose \
--project-directory "${WARDEN_ENV_PATH}" \
Expand Down
8 changes: 7 additions & 1 deletion commands/sync.cmd
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,12 @@ if (( ${#WARDEN_PARAMS[@]} == 0 )); then
exit 1
fi

## attempt to install mutagen if not already present
if ! which mutagen >/dev/null; then
echo -e "\033[33mMutagen could not be found; attempting install via brew.\033[0m"
brew install havoc-io/mutagen/mutagen
fi

## sub-command execution
case "${WARDEN_PARAMS[0]}" in
start)
Expand All @@ -26,7 +32,7 @@ case "${WARDEN_PARAMS[0]}" in
## create sync session based on environment type configuration
mutagen create -c "${WARDEN_DIR}/environments/${WARDEN_ENV_TYPE}.toml" \
--label "warden-sync=${WARDEN_ENV_NAME}" \
"${WARDEN_ENV_PATH}" "docker://$(warden env ps -q php-fpm)/var/www/html"
"${WARDEN_ENV_PATH}${WARDEN_WEB_ROOT:-}" "docker://$(warden env ps -q php-fpm)/var/www/html"

## wait for sync session to complete initial sync before exiting
echo "Waiting for initial synchronization to complete"
Expand Down
2 changes: 1 addition & 1 deletion commands/usage.help
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ WARDEN_HEADER='

WARDEN_USAGE=$(cat <<EOF
${WARDEN_HEADER:1}
Warden version 0.1.0-beta4
Warden version 0.1.0-beta5
\033[33mUsage:\033[0m
command [options] [arguments]
Expand Down
6 changes: 3 additions & 3 deletions environments/magento1.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ services:
- db
- php-fpm
volumes:
- ./:/var/www/html:delegated
- .${WARDEN_WEB_ROOT:-}/:/var/www/html:delegated
labels:
- traefik.docker.network=warden
- traefik.frontend.rule=Host:${TRAEFIK_SUBDOMAIN:-www}.${TRAEFIK_DOMAIN}
Expand All @@ -21,12 +21,12 @@ services:

php-fpm:
hostname: php-fpm
image: davidalger/php:${PHP_VERSION:-7.2}-fpm-alpine
image: davidalger/warden:mage1-fpm-${PHP_VERSION:-7.2}-alpine
depends_on:
- db
volumes:
- ~/.composer:/home/www-data/.composer:delegated
- ./:/var/www/html:delegated
- .${WARDEN_WEB_ROOT:-}/:/var/www/html:delegated

db:
hostname: mariadb
Expand Down
6 changes: 3 additions & 3 deletions environments/magento2-mutagen.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ services:
- db
- php-fpm
volumes:
- ./pub/media:/var/www/html/pub/media:delegated
- .${WARDEN_WEB_ROOT:-}/pub/media:/var/www/html/pub/media:delegated
- appdata:/var/www/html

varnish:
Expand All @@ -26,12 +26,12 @@ services:

php-fpm:
hostname: php-fpm
image: davidalger/php:${PHP_VERSION:-7.2}-fpm-alpine
image: davidalger/warden:mage2-fpm-${PHP_VERSION:-7.2}-alpine
depends_on:
- db
volumes:
- ~/.composer:/home/www-data/.composer:delegated
- ./pub/media:/var/www/html/pub/media:delegated
- .${WARDEN_WEB_ROOT:-}/pub/media:/var/www/html/pub/media:delegated
- appdata:/var/www/html

db:
Expand Down
6 changes: 3 additions & 3 deletions environments/magento2-native.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ services:
- db
- php-fpm
volumes:
- ./:/var/www/html:delegated
- .${WARDEN_WEB_ROOT:-}/:/var/www/html:delegated

varnish:
hostname: varnish
Expand All @@ -25,12 +25,12 @@ services:

php-fpm:
hostname: php-fpm
image: davidalger/php:${PHP_VERSION:-7.2}-fpm-alpine
image: davidalger/warden:mage2-fpm-${PHP_VERSION:-7.2}-alpine
depends_on:
- db
volumes:
- ~/.composer:/home/www-data/.composer:delegated
- ./:/var/www/html:delegated
- .${WARDEN_WEB_ROOT:-}/:/var/www/html:delegated

db:
hostname: mariadb
Expand Down

0 comments on commit 9350f25

Please sign in to comment.