Skip to content

Commit

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

* Added support for extending environment configuration on a per-project basis via `.warden/warden-env.yml` and `.warden/warden-env.<WARDEN_ENV_TYPE>.yml` files
* Added `local` env type to support projects which do not conform to any of the templated environments suppoprted out-of-the-box
* Changed Traefik configuration to automatically use the warden docker network (eliminates need for `traefik.docker.network=warden` label on all proxied containers
* Changed Traefik configuration to require containers be explicitly enabled for Traefik via the label `traefik.enable=true`
* Changed docker-compose environment type templates to version 3.5 for better extendability in project override files
* Fixed bug where resolver setup on macOS would fail if `/etc/resolver` dir was already present during install (PR #1 by @fooman)

0.1.0-beta5
===============

Expand Down
8 changes: 8 additions & 0 deletions commands/db.cmd
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,14 @@ fi
eval "$(grep "^MYSQL_" "${WARDEN_ENV_PATH}/.env")"
eval "$(grep -E '^\W+- MYSQL_.*=\$\{.*\}' "${WARDEN_DIR}/environments/${WARDEN_ENV_TYPE}.yml" | sed -E 's/.*- //g')"

if [[ -f "${WARDEN_ENV_PATH}/.warden/warden-env.yml" ]]; then
eval "$(grep -E '^\W+- MYSQL_.*=\$\{.*\}' "${WARDEN_ENV_PATH}/.warden/warden-env.yml" | sed -E 's/.*- //g')"
fi

if [[ -f "${WARDEN_ENV_PATH}/.warden/warden-env.${WARDEN_ENV_TYPE}.yml" ]]; then
eval "$(grep -E '^\W+- MYSQL_.*=\$\{.*\}' "${WARDEN_ENV_PATH}/.warden/warden-env.${WARDEN_ENV_TYPE}.yml" | sed -E 's/.*- //g')"
fi

## sub-command execution
case "${WARDEN_PARAMS[0]}" in
connect)
Expand Down
17 changes: 13 additions & 4 deletions commands/env.cmd
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,18 @@ fi
## simply allow the return code from docker-compose to bubble up per normal
trap '' ERR

## configure docker-compose files
DOCKER_COMPOSE_ARGS=-f\ "${WARDEN_DIR}/environments/${WARDEN_ENV_TYPE}.yml"

if [[ -f "${WARDEN_ENV_PATH}/.warden/warden-env.yml" ]]; then
DOCKER_COMPOSE_ARGS+=\ -f\ "${WARDEN_ENV_PATH}/.warden/warden-env.yml"
fi

if [[ -f "${WARDEN_ENV_PATH}/.warden/warden-env.${WARDEN_ENV_TYPE}.yml" ]]; then
DOCKER_COMPOSE_ARGS+=\ -f\ "${WARDEN_ENV_PATH}/.warden/warden-env.${WARDEN_ENV_TYPE}.yml"
fi

## anything not caught above is simply passed through to docker-compose to orchestrate
docker-compose \
--project-directory "${WARDEN_ENV_PATH}" \
-p "${WARDEN_ENV_NAME}" \
-f "${WARDEN_DIR}/environments/${WARDEN_ENV_TYPE}.yml" \
"${WARDEN_PARAMS[@]}" "$@"
--project-directory "${WARDEN_ENV_PATH}" -p "${WARDEN_ENV_NAME}" \
${DOCKER_COMPOSE_ARGS} "${WARDEN_PARAMS[@]}" "$@"
4 changes: 3 additions & 1 deletion commands/install.cmd
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,9 @@ if [[ "$OSTYPE" == "linux-gnu" ]]; then
elif [[ "$OSTYPE" == "darwin"* ]]; then
if [[ ! -f /etc/resolver/test ]]; then
echo "==> Configuring resolver for .test domains (requires sudo privileges)"
sudo mkdir /etc/resolver
if [[ ! -d /etc/resolver ]]; then
sudo mkdir /etc/resolver
fi
echo "nameserver 127.0.0.1" | sudo tee /etc/resolver/test >/dev/null
fi
else
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-beta5
Warden version 0.1.0-beta6
\033[33mUsage:\033[0m
command [options] [arguments]
Expand Down
10 changes: 9 additions & 1 deletion docker/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,12 @@ services:
traefik:
container_name: traefik
image: traefik
command: --api --docker --docker.domain=test
command: |
--api
--docker
--docker.domain=test
--docker.network=warden
--docker.exposedByDefault=false
ports:
- "80:80" # The HTTP port
- "443:443" # The HTTPS port
Expand All @@ -12,6 +17,7 @@ services:
- ~/.warden/ssl/certs:/etc/ssl/certs
- /var/run/docker.sock:/var/run/docker.sock
labels:
- traefik.enable=true
- traefik.port=8080
restart: always

Expand All @@ -22,6 +28,7 @@ services:
- /var/run/docker.sock:/var/run/docker.sock
- portainer:/data
labels:
- traefik.enable=true
- traefik.port=9000
restart: always

Expand All @@ -33,6 +40,7 @@ services:
volumes:
- ~/.warden/etc/dnsmasq.conf:/etc/dnsmasq.conf
labels:
- traefik.enable=true
- traefik.port=8080
restart: always

Expand Down
4 changes: 4 additions & 0 deletions environments/local.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
version: "3.5"
networks:
warden:
external: true
5 changes: 3 additions & 2 deletions environments/magento1.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,8 @@ services:
volumes:
- .${WARDEN_WEB_ROOT:-}/:/var/www/html:delegated
labels:
- traefik.docker.network=warden
- traefik.enable=true
- traefik.port=80
- traefik.frontend.rule=Host:${TRAEFIK_SUBDOMAIN:-www}.${TRAEFIK_DOMAIN}
networks:
- warden
Expand Down Expand Up @@ -50,7 +51,7 @@ services:
hostname: mailhog
image: mailhog/mailhog:${MAILHOG_VERSION:-v1.0.0}
labels:
- traefik.docker.network=warden
- traefik.enable=true
- traefik.port=8025
- traefik.frontend.rule=Host:mailhog.${TRAEFIK_DOMAIN}
networks:
Expand Down
10 changes: 5 additions & 5 deletions environments/magento2-mutagen.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
version: "3"
version: "3.5"

services:

Expand All @@ -18,7 +18,7 @@ services:
depends_on:
- nginx
labels:
- traefik.docker.network=warden
- traefik.enable=true
- traefik.frontend.rule=Host:${TRAEFIK_SUBDOMAIN:-www}.${TRAEFIK_DOMAIN}
networks:
- warden
Expand Down Expand Up @@ -52,7 +52,7 @@ services:
hostname: elasticsearch
image: davidalger/warden:elasticsearch-${ELASTICSEARCH_VERSION:-5.6}-alpine
labels:
- traefik.docker.network=warden
- traefik.enable=true
- traefik.port=9200
- traefik.frontend.rule=Host:elasticsearch.${TRAEFIK_DOMAIN}
volumes:
Expand All @@ -69,7 +69,7 @@ services:
hostname: rabbitmq
image: rabbitmq:${RABBITMQ_VERSION:-3.7.14}-management-alpine
labels:
- traefik.docker.network=warden
- traefik.enable=true
- traefik.port=15672
- traefik.frontend.rule=Host:rabbitmq.${TRAEFIK_DOMAIN}
networks:
Expand All @@ -80,7 +80,7 @@ services:
hostname: mailhog
image: mailhog/mailhog:${MAILHOG_VERSION:-v1.0.0}
labels:
- traefik.docker.network=warden
- traefik.enable=true
- traefik.port=8025
- traefik.frontend.rule=Host:mailhog.${TRAEFIK_DOMAIN}
networks:
Expand Down
10 changes: 5 additions & 5 deletions environments/magento2-native.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
version: "3"
version: "3.5"

services:

Expand All @@ -17,7 +17,7 @@ services:
depends_on:
- nginx
labels:
- traefik.docker.network=warden
- traefik.enable=true
- traefik.frontend.rule=Host:${TRAEFIK_SUBDOMAIN:-www}.${TRAEFIK_DOMAIN}
networks:
- warden
Expand Down Expand Up @@ -50,7 +50,7 @@ services:
hostname: elasticsearch
image: mage2click/magento-elasticsearch:${ELASTICSEARCH_VERSION:-5.6}
labels:
- traefik.docker.network=warden
- traefik.enable=true
- traefik.port=9200
- traefik.frontend.rule=Host:elasticsearch.${TRAEFIK_DOMAIN}
volumes:
Expand All @@ -67,7 +67,7 @@ services:
hostname: rabbitmq
image: rabbitmq:${RABBITMQ_VERSION:-3.7.14}-management-alpine
labels:
- traefik.docker.network=warden
- traefik.enable=true
- traefik.port=15672
- traefik.frontend.rule=Host:rabbitmq.${TRAEFIK_DOMAIN}
networks:
Expand All @@ -78,7 +78,7 @@ services:
hostname: mailhog
image: mailhog/mailhog:${MAILHOG_VERSION:-v1.0.0}
labels:
- traefik.docker.network=warden
- traefik.enable=true
- traefik.port=8025
- traefik.frontend.rule=Host:mailhog.${TRAEFIK_DOMAIN}
networks:
Expand Down

0 comments on commit a7b416d

Please sign in to comment.