Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/develop' for release 0.4.0
Browse files Browse the repository at this point in the history
  • Loading branch information
davidalger committed Apr 2, 2020
2 parents e96901b + 4f7c57d commit d9a6e2d
Show file tree
Hide file tree
Showing 72 changed files with 603 additions and 144 deletions.
21 changes: 21 additions & 0 deletions .github/workflows/docker-image-mysql.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
name: Docker Image MySQL
on:
schedule:
- cron: "0 6 * * 1" # 6 AM UTC on Monday
push:
paths:
- version
- images/mysql/**
branches:
- develop
jobs:
mysql:
name: MySQL
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
- run: ./images/scripts/build.sh --push "${BUILD_GROUP}"
env:
BUILD_GROUP: mysql
DOCKER_USERNAME: ${{ secrets.DOCKER_USERNAME }}
DOCKER_PASSWORD: ${{ secrets.DOCKER_PASSWORD }}
21 changes: 20 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,26 @@
# Change Log

## 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.3.1..develop)
[All Commits](https://github.com/davidalger/warden/compare/0.4.0..develop)

## Version [0.4.0](https://github.com/davidalger/warden/tree/0.4.0) (2020-04-02)
[All Commits](https://github.com/davidalger/warden/compare/0.3.1..0.4.0)

**Enhancements:**

* Added MySQL 5.6 and 5.7 images to Quay repository for use with Warden environments
* Added support for Integration, Unit and API Tests leveraging a `MySQL 5.7` container running on `tempfs` memory disk ([#121](https://github.com/davidalger/warden/pull/115) by @lbajsarowicz)
* Added `WARDEN_ALLURE` setting to control Allure separately from Selenium for use reporting on Integration and Unit tests ([#121](https://github.com/davidalger/warden/pull/117) by @lbajsarowicz)
* Added ssh agent forwarding support on both macOS and Linux hosts ([#121](https://github.com/davidalger/warden/pull/121) by @davidalger)
* Updated entrypoint in php-fpm images to support mounting PEM files into `/etc/pki/ca-trust/source/anchors` ([3a841b7d](https://github.com/davidalger/warden/commit/3a841b7dd80c6827bc8bf238ae8ff53b2519a258))
* Updated config for Mutagen sync to exclude large files (*.sql, *.gz, *.zip, *.bz2) from sync sessions

**Bug Fixes:**

* Fixed issue where `-` in `WARDEN_ENV_NAME` would results in `0.0.0.0` being used in `extra_hosts` passed to containers
* Fixed race condition caused by docker-compose starting two containers with identical mounts simultaneously (issue [#110](https://github.com/davidalger/warden/issues/110))
* Fixed issue with incorrect network name reference when uppercase characters are present in `WARDEN_ENV_NAME` (issue [#127](https://github.com/davidalger/warden/issues/127))
* Fixed issue where Mutagen sync autostart would attempt to start when php-fpm container was not running (ex: when executing `warden env up -d db` to start only the db service)

## Version [0.3.1](https://github.com/davidalger/warden/tree/0.3.1) (2020-03-06)
[All Commits](https://github.com/davidalger/warden/compare/0.3.0..0.3.1)
Expand Down
12 changes: 9 additions & 3 deletions commands/db.cmd
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#!/usr/bin/env bash
[[ ! ${WARDEN_COMMAND} ]] && >&2 echo -e "\033[31mThis script is not intended to be run directly!" && exit 1
[[ ! ${WARDEN_COMMAND} ]] && >&2 echo -e "\033[31mThis script is not intended to be run directly!\033[0m" && exit 1

source "${WARDEN_DIR}/utils/env.sh"
WARDEN_ENV_PATH="$(locateEnvPath)" || exit $?
Expand All @@ -12,14 +12,20 @@ fi

## load connection information for the mysql service
eval "$(grep "^MYSQL_" "${WARDEN_ENV_PATH}/.env")"
eval "$(grep -E '^\W+- MYSQL_.*=\$\{.*\}' "${WARDEN_DIR}/environments/${WARDEN_ENV_TYPE}.base.yml" | sed -E 's/.*- //g')"
eval "$(
grep -E '^\W+- MYSQL_.*=\$\{.*\}' "${WARDEN_DIR}/environments/${WARDEN_ENV_TYPE}/${WARDEN_ENV_TYPE}.base.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_SUBT}.yml" ]]; then
eval "$(grep -E '^\W+- MYSQL_.*=\$\{.*\}' "${WARDEN_ENV_PATH}/.warden/warden-env.${WARDEN_ENV_SUBT}.yml" | sed -E 's/.*- //g')"
eval "$(
grep -E '^\W+- MYSQL_.*=\$\{.*\}' "${WARDEN_ENV_PATH}/.warden/warden-env.${WARDEN_ENV_SUBT}.yml" \
| sed -E 's/.*- //g'
)"
fi

## sub-command execution
Expand Down
2 changes: 1 addition & 1 deletion commands/db.help
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#!/usr/bin/env bash
[[ ! ${WARDEN_COMMAND} ]] && >&2 echo -e "\033[31mThis script is not intended to be run directly!" && exit 1
[[ ! ${WARDEN_COMMAND} ]] && >&2 echo -e "\033[31mThis script is not intended to be run directly!\033[0m" && exit 1

WARDEN_USAGE=$(cat <<EOF
\033[33mUsage:\033[0m
Expand Down
2 changes: 1 addition & 1 deletion commands/debug.cmd
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#!/usr/bin/env bash
[[ ! ${WARDEN_COMMAND} ]] && >&2 echo -e "\033[31mThis script is not intended to be run directly!" && exit 1
[[ ! ${WARDEN_COMMAND} ]] && >&2 echo -e "\033[31mThis script is not intended to be run directly!\033[0m" && exit 1

source "${WARDEN_DIR}/utils/env.sh"
WARDEN_ENV_PATH="$(locateEnvPath)" || exit $?
Expand Down
2 changes: 1 addition & 1 deletion commands/debug.help
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#!/usr/bin/env bash
[[ ! ${WARDEN_COMMAND} ]] && >&2 echo -e "\033[31mThis script is not intended to be run directly!" && exit 1
[[ ! ${WARDEN_COMMAND} ]] && >&2 echo -e "\033[31mThis script is not intended to be run directly!\033[0m" && exit 1

WARDEN_USAGE=$(cat <<EOF
\033[33mUsage:\033[0m
Expand Down
2 changes: 1 addition & 1 deletion commands/down.cmd
100755 → 100644
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#!/usr/bin/env bash
[[ ! ${WARDEN_COMMAND} ]] && >&2 echo -e "\033[31mThis script is not intended to be run directly!" && exit 1
[[ ! ${WARDEN_COMMAND} ]] && >&2 echo -e "\033[31mThis script is not intended to be run directly!\033[0m" && exit 1

pushd "${WARDEN_HOME_DIR}" >/dev/null
docker-compose -p warden -f "${WARDEN_DIR}/docker/docker-compose.yml" down "${WARDEN_PARAMS[@]}" "$@"
8 changes: 5 additions & 3 deletions commands/env-init.cmd
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
#!/usr/bin/env bash
[[ ! ${WARDEN_COMMAND} ]] && >&2 echo -e "\033[31mThis script is not intended to be run directly!" && exit 1
[[ ! ${WARDEN_COMMAND} ]] && >&2 echo -e "\033[31mThis script is not intended to be run directly!\033[0m" && exit 1

source "${WARDEN_DIR}/utils/env.sh"
WARDEN_ENV_PATH="$(pwd -P)"

# TODO: If the .env file already exists; prompt user instead of overwriting
Expand All @@ -13,8 +14,7 @@ WARDEN_ENV_TYPE="${WARDEN_PARAMS[1]:-}"
[[ ! ${WARDEN_ENV_NAME} ]] && >&2 echo -e "\033[31mMissing required argument. Please use --help to to print usage.\033[0m" && exit 1

# Verify the auto-select and/or type path resolves correctly before setting it
[[ ! -f "${WARDEN_DIR}/environments/${WARDEN_ENV_TYPE}.base.yml" ]] \
&& >&2 echo -e "\033[31mInvalid environment type \"${WARDEN_ENV_TYPE}\" specified.\033[0m" && exit 1
assertValidEnvType || exit $?

# Write the .env file to current working directory
cat > "${WARDEN_ENV_PATH}/.env" <<EOF
Expand Down Expand Up @@ -58,11 +58,13 @@ if [[ "${WARDEN_ENV_TYPE}" == "magento2" ]]; then
REDIS_VERSION=5.0
VARNISH_VERSION=6.0
WARDEN_ALLURE=0
WARDEN_SELENIUM=0
WARDEN_SELENIUM_DEBUG=0
WARDEN_BLACKFIRE=0
WARDEN_SPLIT_SALES=0
WARDEN_SPLIT_CHECKOUT=0
WARDEN_TEST_DB=0
BLACKFIRE_CLIENT_ID=
BLACKFIRE_CLIENT_TOKEN=
Expand Down
2 changes: 1 addition & 1 deletion commands/env-init.help
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#!/usr/bin/env bash
[[ ! ${WARDEN_COMMAND} ]] && >&2 echo -e "\033[31mThis script is not intended to be run directly!" && exit 1
[[ ! ${WARDEN_COMMAND} ]] && >&2 echo -e "\033[31mThis script is not intended to be run directly!\033[0m" && exit 1

WARDEN_USAGE=$(cat <<EOF
\033[33mUsage:\033[0m
Expand Down
66 changes: 30 additions & 36 deletions commands/env.cmd
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#!/usr/bin/env bash
[[ ! ${WARDEN_COMMAND} ]] && >&2 echo -e "\033[31mThis script is not intended to be run directly!" && exit 1
[[ ! ${WARDEN_COMMAND} ]] && >&2 echo -e "\033[31mThis script is not intended to be run directly!\033[0m" && exit 1

source "${WARDEN_DIR}/utils/core.sh"
source "${WARDEN_DIR}/utils/env.sh"
Expand All @@ -17,34 +17,30 @@ trap '' ERR

## configure docker-compose files
DOCKER_COMPOSE_ARGS=()
DOCKER_COMPOSE_ARGS+=("-f")
DOCKER_COMPOSE_ARGS+=("${WARDEN_DIR}/environments/${WARDEN_ENV_TYPE}.base.yml")

if [[ -f "${WARDEN_DIR}/environments/${WARDEN_ENV_TYPE}.${WARDEN_ENV_SUBT}.yml" ]]; then
DOCKER_COMPOSE_ARGS+=("-f")
DOCKER_COMPOSE_ARGS+=("${WARDEN_DIR}/environments/${WARDEN_ENV_TYPE}.${WARDEN_ENV_SUBT}.yml")
fi
appendEnvPartialIfExists "base"
appendEnvPartialIfExists "${WARDEN_ENV_SUBT}"

if [[ ${WARDEN_SPLIT_SALES} -eq 1 && -f "${WARDEN_DIR}/environments/${WARDEN_ENV_TYPE}.splitdb.sales.yml" ]]; then
DOCKER_COMPOSE_ARGS+=("-f")
DOCKER_COMPOSE_ARGS+=("${WARDEN_DIR}/environments/${WARDEN_ENV_TYPE}.splitdb.sales.yml")
fi
[[ ${WARDEN_TEST_DB} -eq 1 ]] \
&& appendEnvPartialIfExists "tests"

if [[ ${WARDEN_SPLIT_CHECKOUT} -eq 1 && -f "${WARDEN_DIR}/environments/${WARDEN_ENV_TYPE}.splitdb.checkout.yml" ]]; then
DOCKER_COMPOSE_ARGS+=("-f")
DOCKER_COMPOSE_ARGS+=("${WARDEN_DIR}/environments/${WARDEN_ENV_TYPE}.splitdb.checkout.yml")
fi
[[ ${WARDEN_SPLIT_SALES} -eq 1 ]] \
&& appendEnvPartialIfExists "splitdb.sales"

if [[ ${WARDEN_BLACKFIRE} -eq 1 && -f "${WARDEN_DIR}/environments/${WARDEN_ENV_TYPE}.blackfire.base.yml" ]]; then
DOCKER_COMPOSE_ARGS+=("-f")
DOCKER_COMPOSE_ARGS+=("${WARDEN_DIR}/environments/${WARDEN_ENV_TYPE}.blackfire.base.yml")
fi
[[ ${WARDEN_SPLIT_CHECKOUT} -eq 1 ]] \
&& appendEnvPartialIfExists "splitdb.checkout"

if [[ ${WARDEN_BLACKFIRE} -eq 1 && -f "${WARDEN_DIR}/environments/${WARDEN_ENV_TYPE}.blackfire.${WARDEN_ENV_SUBT}.yml" ]]; then
DOCKER_COMPOSE_ARGS+=("-f")
DOCKER_COMPOSE_ARGS+=("${WARDEN_DIR}/environments/${WARDEN_ENV_TYPE}.blackfire.${WARDEN_ENV_SUBT}.yml")
if [[ ${WARDEN_BLACKFIRE} -eq 1 ]]; then
appendEnvPartialIfExists "blackfire.base"
appendEnvPartialIfExists "blackfire.${WARDEN_ENV_SUBT}"
fi

[[ ${WARDEN_ALLURE} -eq 1 ]] \
&& appendEnvPartialIfExists "allure"

[[ ${WARDEN_SELENIUM} -eq 1 ]] \
&& appendEnvPartialIfExists "selenium.base"

if [[ -f "${WARDEN_ENV_PATH}/.warden/warden-env.yml" ]]; then
DOCKER_COMPOSE_ARGS+=("-f")
DOCKER_COMPOSE_ARGS+=("${WARDEN_ENV_PATH}/.warden/warden-env.yml")
Expand All @@ -55,11 +51,6 @@ if [[ -f "${WARDEN_ENV_PATH}/.warden/warden-env.${WARDEN_ENV_SUBT}.yml" ]]; then
DOCKER_COMPOSE_ARGS+=("${WARDEN_ENV_PATH}/.warden/warden-env.${WARDEN_ENV_SUBT}.yml")
fi

if [[ ${WARDEN_SELENIUM} -eq 1 && -f "${WARDEN_DIR}/environments/${WARDEN_ENV_TYPE}.selenium.base.yml" ]]; then
DOCKER_COMPOSE_ARGS+=("-f")
DOCKER_COMPOSE_ARGS+=("${WARDEN_DIR}/environments/${WARDEN_ENV_TYPE}.selenium.base.yml")
fi

if [[ ${WARDEN_SELENIUM_DEBUG} -eq 1 ]]; then
export WARDEN_SELENIUM_DEBUG="-debug"
else
Expand All @@ -68,27 +59,28 @@ fi

## disconnect peered service containers from environment network
if [[ "${WARDEN_PARAMS[0]}" == "down" ]]; then
disconnectPeeredServices "${WARDEN_ENV_NAME}_default"
disconnectPeeredServices "$(renderEnvNetworkName)"
fi

## connect peered service containers to environment network
if [[ "${WARDEN_PARAMS[0]}" == "up" ]]; then
## create environment network for attachments if it does not already exist
if [[ $(docker network ls -f "name=${WARDEN_ENV_NAME}_default" -q) == "" ]]; then
if [[ $(docker network ls -f "name=$(renderEnvNetworkName)" -q) == "" ]]; then
docker-compose \
--project-directory "${WARDEN_ENV_PATH}" -p "${WARDEN_ENV_NAME}" \
"${DOCKER_COMPOSE_ARGS[@]}" up --no-start
fi

## connect globally peered services to the environment network
connectPeeredServices "${WARDEN_ENV_NAME}_default"
connectPeeredServices "$(renderEnvNetworkName)"
fi

## lookup address of traefik container on environment network
export TRAEFIK_ADDRESS="$(docker container inspect traefik \
--format "{{if .NetworkSettings.Networks.${WARDEN_ENV_NAME}_default}} \
{{.NetworkSettings.Networks.${WARDEN_ENV_NAME}_default.IPAddress}} \
{{end}}" 2>/dev/null || true \
--format '
{{- $network := index .NetworkSettings.Networks "'"$(renderEnvNetworkName)"'" -}}
{{- if $network }}{{ $network.IPAddress }}{{ end -}}
' 2>/dev/null || true
)"

## anything not caught above is simply passed through to docker-compose to orchestrate
Expand All @@ -98,15 +90,17 @@ docker-compose \

## start mutagen sync if needed
if ([[ "${WARDEN_PARAMS[0]}" == "up" ]] || [[ "${WARDEN_PARAMS[0]}" == "start" ]]) \
&& [[ $OSTYPE =~ ^darwin ]] && [[ -f "${WARDEN_DIR}/environments/${WARDEN_ENV_TYPE}.mutagen.yml" ]] \
&& [[ $(warden sync list | grep -i 'Connection state: Connected' | wc -l | awk '{print $1}') != "2" ]]
&& [[ $OSTYPE =~ ^darwin ]] && [[ -f "${WARDEN_DIR}/environments/${WARDEN_ENV_TYPE}/${WARDEN_ENV_TYPE}.mutagen.yml" ]] \
&& [[ $(warden sync list | grep -i 'Connection state: Connected' | wc -l | awk '{print $1}') != "2" ]] \
&& [[ $(warden env ps -q php-fpm) ]] \
&& [[ $(docker container inspect $(warden env ps -q php-fpm) --format '{{ .State.Status }}') = "running" ]]
then
warden sync start
fi

## stop mutagen sync if needed
if ([[ "${WARDEN_PARAMS[0]}" == "down" ]] || [[ "${WARDEN_PARAMS[0]}" == "stop" ]]) \
&& [[ $OSTYPE =~ ^darwin ]] && [[ -f "${WARDEN_DIR}/environments/${WARDEN_ENV_TYPE}.mutagen.yml" ]]
&& [[ $OSTYPE =~ ^darwin ]] && [[ -f "${WARDEN_DIR}/environments/${WARDEN_ENV_TYPE}/${WARDEN_ENV_TYPE}.mutagen.yml" ]]
then
warden sync stop
fi
2 changes: 1 addition & 1 deletion commands/env.help
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#!/usr/bin/env bash
[[ ! ${WARDEN_COMMAND} ]] && >&2 echo -e "\033[31mThis script is not intended to be run directly!" && exit 1
[[ ! ${WARDEN_COMMAND} ]] && >&2 echo -e "\033[31mThis script is not intended to be run directly!\033[0m" && exit 1

COMPOSE_USAGE=$(docker-compose "${WARDEN_PARAMS[@]}" "$@" \
| grep -vE '(--file|--project-name|--project-directory|default: docker-compose.yml|default: directory name)' \
Expand Down
2 changes: 1 addition & 1 deletion commands/install.cmd
100755 → 100644
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#!/usr/bin/env bash
[[ ! ${WARDEN_COMMAND} ]] && >&2 echo -e "\033[31mThis script is not intended to be run directly!" && exit 1
[[ ! ${WARDEN_COMMAND} ]] && >&2 echo -e "\033[31mThis script is not intended to be run directly!\033[0m" && exit 1

source "${WARDEN_DIR}/utils/core.sh"
source "${WARDEN_DIR}/utils/install.sh"
Expand Down
2 changes: 1 addition & 1 deletion commands/restart.cmd
100755 → 100644
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#!/usr/bin/env bash
[[ ! ${WARDEN_COMMAND} ]] && >&2 echo -e "\033[31mThis script is not intended to be run directly!" && exit 1
[[ ! ${WARDEN_COMMAND} ]] && >&2 echo -e "\033[31mThis script is not intended to be run directly!\033[0m" && exit 1

source "${WARDEN_DIR}/utils/install.sh"
assertWardenInstall
Expand Down
2 changes: 1 addition & 1 deletion commands/shell.cmd
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#!/usr/bin/env bash
[[ ! ${WARDEN_COMMAND} ]] && >&2 echo -e "\033[31mThis script is not intended to be run directly!" && exit 1
[[ ! ${WARDEN_COMMAND} ]] && >&2 echo -e "\033[31mThis script is not intended to be run directly!\033[0m" && exit 1

source "${WARDEN_DIR}/utils/env.sh"
WARDEN_ENV_PATH="$(locateEnvPath)" || exit $?
Expand Down
2 changes: 1 addition & 1 deletion commands/shell.help
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#!/usr/bin/env bash
[[ ! ${WARDEN_COMMAND} ]] && >&2 echo -e "\033[31mThis script is not intended to be run directly!" && exit 1
[[ ! ${WARDEN_COMMAND} ]] && >&2 echo -e "\033[31mThis script is not intended to be run directly!\033[0m" && exit 1

WARDEN_USAGE=$(cat <<EOF
\033[33mUsage:\033[0m
Expand Down
2 changes: 1 addition & 1 deletion commands/sign-certificate.cmd
100755 → 100644
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#!/usr/bin/env bash
[[ ! ${WARDEN_COMMAND} ]] && >&2 echo -e "\033[31mThis script is not intended to be run directly!" && exit 1
[[ ! ${WARDEN_COMMAND} ]] && >&2 echo -e "\033[31mThis script is not intended to be run directly!\033[0m" && exit 1

mkdir -p "${WARDEN_SSL_DIR}/certs"

Expand Down
2 changes: 1 addition & 1 deletion commands/sign-certificate.help
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#!/usr/bin/env bash
[[ ! ${WARDEN_COMMAND} ]] && >&2 echo -e "\033[31mThis script is not intended to be run directly!" && exit 1
[[ ! ${WARDEN_COMMAND} ]] && >&2 echo -e "\033[31mThis script is not intended to be run directly!\033[0m" && exit 1

WARDEN_USAGE=$(cat <<EOF
\033[33mUsage:\033[0m
Expand Down
2 changes: 1 addition & 1 deletion commands/start.cmd
100755 → 100644
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#!/usr/bin/env bash
[[ ! ${WARDEN_COMMAND} ]] && >&2 echo -e "\033[31mThis script is not intended to be run directly!" && exit 1
[[ ! ${WARDEN_COMMAND} ]] && >&2 echo -e "\033[31mThis script is not intended to be run directly!\033[0m" && exit 1

source "${WARDEN_DIR}/utils/install.sh"
assertWardenInstall
Expand Down
2 changes: 1 addition & 1 deletion commands/stop.cmd
100755 → 100644
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#!/usr/bin/env bash
[[ ! ${WARDEN_COMMAND} ]] && >&2 echo -e "\033[31mThis script is not intended to be run directly!" && exit 1
[[ ! ${WARDEN_COMMAND} ]] && >&2 echo -e "\033[31mThis script is not intended to be run directly!\033[0m" && exit 1

pushd "${WARDEN_HOME_DIR}" >/dev/null
docker-compose -p warden -f "${WARDEN_DIR}/docker/docker-compose.yml" stop "${WARDEN_PARAMS[@]}" "$@"
6 changes: 3 additions & 3 deletions commands/sync.cmd
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#!/usr/bin/env bash
[[ ! ${WARDEN_COMMAND} ]] && >&2 echo -e "\033[31mThis script is not intended to be run directly!" && exit 1
[[ ! ${WARDEN_COMMAND} ]] && >&2 echo -e "\033[31mThis script is not intended to be run directly!\033[0m" && exit 1

source "${WARDEN_DIR}/utils/core.sh"
source "${WARDEN_DIR}/utils/env.sh"
Expand Down Expand Up @@ -34,7 +34,7 @@ if [[ $OSTYPE =~ ^darwin ]] && ! test $(version ${MUTAGEN_VERSION}) -ge $(versio
fi

## if no mutagen configuration file exists for the environment type, exit with error
if [[ ! -f "${WARDEN_DIR}/environments/${WARDEN_ENV_TYPE}.mutagen.yml" ]]; then
if [[ ! -f "${WARDEN_DIR}/environments/${WARDEN_ENV_TYPE}/${WARDEN_ENV_TYPE}.mutagen.yml" ]]; then
>&2 echo -e "\033[31mMutagen configuration does not exist for environment type \"${WARDEN_ENV_TYPE}\"\033[0m"
exit 1
fi
Expand All @@ -46,7 +46,7 @@ case "${WARDEN_PARAMS[0]}" in
mutagen sync terminate --label-selector "warden-sync=${WARDEN_ENV_NAME}"

## create sync session based on environment type configuration
mutagen sync create -c "${WARDEN_DIR}/environments/${WARDEN_ENV_TYPE}.mutagen.yml" \
mutagen sync create -c "${WARDEN_DIR}/environments/${WARDEN_ENV_TYPE}/${WARDEN_ENV_TYPE}.mutagen.yml" \
--label "warden-sync=${WARDEN_ENV_NAME}" \
"${WARDEN_ENV_PATH}${WARDEN_WEB_ROOT:-}" "docker://$(warden env ps -q php-fpm)/var/www/html"

Expand Down
2 changes: 1 addition & 1 deletion commands/sync.help
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#!/usr/bin/env bash
[[ ! ${WARDEN_COMMAND} ]] && >&2 echo -e "\033[31mThis script is not intended to be run directly!" && exit 1
[[ ! ${WARDEN_COMMAND} ]] && >&2 echo -e "\033[31mThis script is not intended to be run directly!\033[0m" && exit 1

WARDEN_USAGE=$(cat <<EOF
\033[33mUsage:\033[0m
Expand Down
2 changes: 1 addition & 1 deletion commands/up.cmd
100755 → 100644
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#!/usr/bin/env bash
[[ ! ${WARDEN_COMMAND} ]] && >&2 echo -e "\033[31mThis script is not intended to be run directly!" && exit 1
[[ ! ${WARDEN_COMMAND} ]] && >&2 echo -e "\033[31mThis script is not intended to be run directly!\033[0m" && exit 1

source "${WARDEN_DIR}/utils/core.sh"
source "${WARDEN_DIR}/utils/install.sh"
Expand Down
2 changes: 1 addition & 1 deletion commands/usage.cmd
100755 → 100644
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#!/usr/bin/env bash
[[ ! ${WARDEN_COMMAND} ]] && >&2 echo -e "\033[31mThis script is not intended to be run directly!" && exit 1
[[ ! ${WARDEN_COMMAND} ]] && >&2 echo -e "\033[31mThis script is not intended to be run directly!\033[0m" && exit 1

## load usage info for the given command falling back on default usage text
if [[ -f "${WARDEN_DIR}/commands/${WARDEN_COMMAND}.help" ]]; then
Expand Down
2 changes: 1 addition & 1 deletion commands/usage.help
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#!/usr/bin/env bash
[[ ! ${WARDEN_COMMAND} ]] && >&2 echo -e "\033[31mThis script is not intended to be run directly!" && exit 1
[[ ! ${WARDEN_COMMAND} ]] && >&2 echo -e "\033[31mThis script is not intended to be run directly!\033[0m" && exit 1

WARDEN_HEADER='
_ __ __
Expand Down
2 changes: 1 addition & 1 deletion commands/version.cmd
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/usr/bin/env bash
[[ ! ${WARDEN_COMMAND} ]] && >&2 echo -e "\033[31mThis script is not intended to be run directly!" && exit 1
[[ ! ${WARDEN_COMMAND} ]] && >&2 echo -e "\033[31mThis script is not intended to be run directly!\033[0m" && exit 1

cat "${WARDEN_DIR}/version"
Loading

0 comments on commit d9a6e2d

Please sign in to comment.