From fd4d7706fb96698f684b3d38716d5fda44f86965 Mon Sep 17 00:00:00 2001 From: Brett Patterson Date: Sun, 25 Feb 2024 21:33:08 -0500 Subject: [PATCH 1/4] Add postgresql support for environments and commands --- commands/db.cmd | 40 +++++-------------- commands/db.help | 6 +-- commands/db.mysql.cmd | 37 +++++++++++++++++ commands/db.postgres.cmd | 39 ++++++++++++++++++ commands/env.cmd | 19 ++++++++- .../drupal/{db.base.yml => db.mysql.base.yml} | 0 environments/drupal/db.postgres.base.yml | 7 ++++ environments/drupal/init.env | 1 + .../{db.base.yml => db.mysql.base.yml} | 0 environments/includes/db.postgres.base.yml | 18 +++++++++ .../{db.base.yml => db.mysql.base.yml} | 0 environments/laravel/db.postgres.base.yml | 7 ++++ environments/laravel/init.env | 5 ++- .../{db.base.yml => db.mysql.base.yml} | 0 environments/magento1/init.env | 6 +-- .../{db.base.yml => db.mysql.base.yml} | 0 environments/magento2/init.env | 6 +-- .../{db.base.yml => db.mysql.base.yml} | 0 environments/shopware/init.env | 6 +-- .../{db.base.yml => db.mysql.base.yml} | 0 environments/symfony/db.postgres.base.yml | 7 ++++ environments/symfony/init.env | 6 +-- .../{db.base.yml => db.mysql.base.yml} | 0 environments/wordpress/init.env | 5 ++- utils/env.sh | 5 +++ 25 files changed, 169 insertions(+), 51 deletions(-) create mode 100644 commands/db.mysql.cmd create mode 100644 commands/db.postgres.cmd rename environments/drupal/{db.base.yml => db.mysql.base.yml} (100%) create mode 100644 environments/drupal/db.postgres.base.yml rename environments/includes/{db.base.yml => db.mysql.base.yml} (100%) create mode 100644 environments/includes/db.postgres.base.yml rename environments/laravel/{db.base.yml => db.mysql.base.yml} (100%) create mode 100644 environments/laravel/db.postgres.base.yml rename environments/magento1/{db.base.yml => db.mysql.base.yml} (100%) rename environments/magento2/{db.base.yml => db.mysql.base.yml} (100%) rename environments/shopware/{db.base.yml => db.mysql.base.yml} (100%) rename environments/symfony/{db.base.yml => db.mysql.base.yml} (100%) create mode 100644 environments/symfony/db.postgres.base.yml rename environments/wordpress/{db.base.yml => db.mysql.base.yml} (100%) diff --git a/commands/db.cmd b/commands/db.cmd index 0e848654..98d35b15 100644 --- a/commands/db.cmd +++ b/commands/db.cmd @@ -5,45 +5,25 @@ WARDEN_ENV_PATH="$(locateEnvPath)" || exit $? loadEnvConfig "${WARDEN_ENV_PATH}" || exit $? assertDockerRunning -if [[ ${WARDEN_DB:-1} -eq 0 ]]; then - fatal "Database environment is not used (WARDEN_DB=0)." -fi +#if [[ ${WARDEN_DB:-1} -eq 0 ]]; then +# fatal "Database environment is not used (WARDEN_DB=0)." +#fi if (( ${#WARDEN_PARAMS[@]} == 0 )) || [[ "${WARDEN_PARAMS[0]}" == "help" ]]; then $WARDEN_BIN db --help || exit $? && exit $? fi -## load connection information for the mysql service +## load connection information for the database service DB_CONTAINER=$($WARDEN_BIN env ps -q db) if [[ ! ${DB_CONTAINER} ]]; then fatal "No container found for db service." fi -eval "$( - docker container inspect ${DB_CONTAINER} --format ' - {{- range .Config.Env }}{{with split . "=" -}} - {{- index . 0 }}='\''{{ range $i, $v := . }}{{ if $i }}{{ $v }}{{ end }}{{ end }}'\''{{println}} - {{- end }}{{ end -}} - ' | grep "^MYSQL_" -)" - -## sub-command execution -case "${WARDEN_PARAMS[0]}" in - connect) - "$WARDEN_BIN" env exec db \ - mysql -u"${MYSQL_USER}" -p"${MYSQL_PASSWORD}" --database="${MYSQL_DATABASE}" "${WARDEN_PARAMS[@]:1}" "$@" - ;; - import) - LC_ALL=C sed -E 's/DEFINER[ ]*=[ ]*`[^`]+`@`[^`]+`/DEFINER=CURRENT_USER/g' \ - | LC_ALL=C sed -E '/\@\@(GLOBAL\.GTID_PURGED|SESSION\.SQL_LOG_BIN)/d' \ - | "$WARDEN_BIN" env exec -T db \ - mysql -u"${MYSQL_USER}" -p"${MYSQL_PASSWORD}" --database="${MYSQL_DATABASE}" "${WARDEN_PARAMS[@]:1}" "$@" - ;; - dump) - "$WARDEN_BIN" env exec -T db \ - mysqldump -u"${MYSQL_USER}" -p"${MYSQL_PASSWORD}" "${MYSQL_DATABASE}" "${WARDEN_PARAMS[@]:1}" "$@" - ;; - *) - fatal "The command \"${WARDEN_PARAMS[0]}\" does not exist. Please use --help for usage." +DB_CMD="mysql" +case ${WARDEN_DB_SYSTEM:-mysql} in + pgsql|postgres|postgresql) + DB_CMD="postgres" ;; esac + +source "${WARDEN_DIR}/commands/db.${DB_CMD}.cmd" diff --git a/commands/db.help b/commands/db.help index 1eba2e81..5b0f50d3 100755 --- a/commands/db.help +++ b/commands/db.help @@ -9,8 +9,8 @@ WARDEN_USAGE=$(cat <&2 echo -e "\033[31mThis script is not intended to be run directly!\033[0m" && exit 1 + +## load connection information for the mysql service +# DB_CONTAINER=$($WARDEN_BIN env ps -q db) +# if [[ ! ${DB_CONTAINER} ]]; then +# fatal "No container found for db service." +# fi + +eval "$( + docker container inspect ${DB_CONTAINER} --format ' + {{- range .Config.Env }}{{with split . "=" -}} + {{- index . 0 }}='\''{{ range $i, $v := . }}{{ if $i }}{{ $v }}{{ end }}{{ end }}'\''{{println}} + {{- end }}{{ end -}} + ' | grep "^MYSQL_" +)" + +## sub-command execution +case "${WARDEN_PARAMS[0]}" in + connect) + "$WARDEN_BIN" env exec db \ + mysql -u"${MYSQL_USER}" -p"${MYSQL_PASSWORD}" --database="${MYSQL_DB}" "${WARDEN_PARAMS[@]:1}" "$@" + ;; + import) + LC_ALL=C sed -E 's/DEFINER[ ]*=[ ]*`[^`]+`@`[^`]+`/DEFINER=CURRENT_USER/g' \ + | LC_ALL=C sed -E '/\@\@(GLOBAL\.GTID_PURGED|SESSION\.SQL_LOG_BIN)/d' \ + | "$WARDEN_BIN" env exec -T db \ + mysql -u"${MYSQL_USER}" -p"${MYSQL_PASSWORD}" --database="${MYSQL_DATABASE}" "${WARDEN_PARAMS[@]:1}" "$@" + ;; + dump) + "$WARDEN_BIN" env exec -T db \ + mysqldump -u"${MYSQL_USER}" -p"${MYSQL_PASSWORD}" "${MYSQL_DATABASE}" "${WARDEN_PARAMS[@]:1}" "$@" + ;; + *) + fatal "The command \"${WARDEN_PARAMS[0]}\" does not exist. Please use --help for usage." + ;; +esac diff --git a/commands/db.postgres.cmd b/commands/db.postgres.cmd new file mode 100644 index 00000000..2e5f01d4 --- /dev/null +++ b/commands/db.postgres.cmd @@ -0,0 +1,39 @@ +#!/usr/bin/env bash +[[ ! ${WARDEN_DIR} ]] && >&2 echo -e "\033[31mThis script is not intended to be run directly!\033[0m" && exit 1 + +## load connection information for the postgres service +# DB_CONTAINER=$($WARDEN_BIN env ps -q db) +# if [[ ! ${DB_CONTAINER} ]]; then +# fatal "No container found for db service." +# fi + +eval "$( + docker container inspect ${DB_CONTAINER} --format ' + {{- range .Config.Env }}{{with split . "=" -}} + {{- index . 0 }}='\''{{ range $i, $v := . }}{{ if $i }}{{ $v }}{{ end }}{{ end }}'\''{{println}} + {{- end }}{{ end -}} + ' | grep "^POSTGRES_" +)" + +CONNECTION_STRING=postgresql://"$POSTGRES_USER":"$POSTGRES_PASSWORD"@127.0.0.1:5432/"$POSTGRES_DB" + +## sub-command execution +case "${WARDEN_PARAMS[0]}" in + connect) + "$WARDEN_BIN" env exec db \ + psql "$CONNECTION_STRING" "${WARDEN_PARAMS[@]:1}" "$@" + ;; + import) + LC_ALL=C sed -E 's/DEFINER[ ]*=[ ]*`[^`]+`@`[^`]+`/DEFINER=current_user/g' \ + | LC_ALL=C sed -E '/\@\@(GLOBAL\.GTID_PURGED|SESSION\.SQL_LOG_BIN)/d' \ + | "$WARDEN_BIN" env exec -T db \ + psql "$CONNECTION_STRING" "${WARDEN_PARAMS[@]:1}" "$@" + ;; + dump) + "$WARDEN_BIN" env exec -T db \ + pg_dump "$CONNECTION_STRING" "${WARDEN_PARAMS[@]:1}" "$@" + ;; + *) + fatal "The command \"${WARDEN_PARAMS[0]}\" does not exist. Please use --help for usage." + ;; +esac diff --git a/commands/env.cmd b/commands/env.cmd index 7f464e1a..c714319a 100644 --- a/commands/env.cmd +++ b/commands/env.cmd @@ -79,8 +79,23 @@ fi [[ ${WARDEN_NGINX} -eq 1 ]] \ && appendEnvPartialIfExists "nginx" -[[ ${WARDEN_DB} -eq 1 ]] \ - && appendEnvPartialIfExists "db" +if [[ ${WARDEN_DB} -eq 1 ]]; then + DB_PARTIAL=("db") + case "${WARDEN_DB_SYSTEM:-mysql}" in + pgsql|postgres|postgresql) + # Reset DB_PARTIAL array to only include PostgreSQL partial + DB_PARTIAL=("db.postgres") + ;; + mysql|mariadb) + DB_PARTIAL+=("db") + DB_PARTIAL+=("db.mysql") + ;; + esac + + for partial in "${DB_PARTIAL[@]}"; do + appendEnvPartialIfExists "${partial}" + done +fi [[ ${WARDEN_ELASTICSEARCH} -eq 1 ]] \ && appendEnvPartialIfExists "elasticsearch" diff --git a/environments/drupal/db.base.yml b/environments/drupal/db.mysql.base.yml similarity index 100% rename from environments/drupal/db.base.yml rename to environments/drupal/db.mysql.base.yml diff --git a/environments/drupal/db.postgres.base.yml b/environments/drupal/db.postgres.base.yml new file mode 100644 index 00000000..ba2547d7 --- /dev/null +++ b/environments/drupal/db.postgres.base.yml @@ -0,0 +1,7 @@ +version: "3.5" +services: + db: + environment: + - POSTGRES_PASSWORD=${DB_ROOT_PASSWORD:-drupal} + - POSTGRES_DB=${DB_DATABASE:-drupal} + - POSTGRES_USER=${DB_USER:-drupal} diff --git a/environments/drupal/init.env b/environments/drupal/init.env index 6b1756fc..8d873547 100644 --- a/environments/drupal/init.env +++ b/environments/drupal/init.env @@ -6,6 +6,7 @@ PHP_VERSION=8.2 PHP_XDEBUG_3=1 WARDEN_DB=1 +WARDEN_DB_SYSTEM=mysql WARDEN_RABBITMQ=0 WARDEN_REDIS=0 diff --git a/environments/includes/db.base.yml b/environments/includes/db.mysql.base.yml similarity index 100% rename from environments/includes/db.base.yml rename to environments/includes/db.mysql.base.yml diff --git a/environments/includes/db.postgres.base.yml b/environments/includes/db.postgres.base.yml new file mode 100644 index 00000000..0ed7c802 --- /dev/null +++ b/environments/includes/db.postgres.base.yml @@ -0,0 +1,18 @@ +version: "3.5" +services: + php-fpm: + depends_on: + - db + + db: + hostname: "${WARDEN_ENV_NAME}-postgres" + image: ${WARDEN_IMAGE_REPOSITORY}/${DB_DISTRIBUTION:-postgres}:${DB_DISTRIBUTION_VERSION:-${DB_VERSION:-16.2}} + environment: + - POSTGRES_PASSWORD=${DB_ROOT_PASSWORD:-app} + - POSTGRES_DB=${DB_DATABASE:-app} + - POSTGRES_USER=${DB_USER:-app} + volumes: + - dbdata:/var/lib/postgresql/data + +volumes: + dbdata: diff --git a/environments/laravel/db.base.yml b/environments/laravel/db.mysql.base.yml similarity index 100% rename from environments/laravel/db.base.yml rename to environments/laravel/db.mysql.base.yml diff --git a/environments/laravel/db.postgres.base.yml b/environments/laravel/db.postgres.base.yml new file mode 100644 index 00000000..8af85e4b --- /dev/null +++ b/environments/laravel/db.postgres.base.yml @@ -0,0 +1,7 @@ +version: "3.5" +services: + db: + environment: + - POSTGRES_PASSWORD=${DB_ROOT_PASSWORD:-laravel} + - POSTGRES_DB=${DB_DATABASE:-laravel} + - POSTGRES_USER=${DB_USER:-laravel} diff --git a/environments/laravel/init.env b/environments/laravel/init.env index 0c97ca6a..ddd09413 100644 --- a/environments/laravel/init.env +++ b/environments/laravel/init.env @@ -1,6 +1,6 @@ -MYSQL_DISTRIBUTION=mariadb -MYSQL_DISTRIBUTION_VERSION=10.4 +DB_DISTRIBUTION=mariadb +DB_DISTRIBUTION_VERSION=10.4 NODE_VERSION=12 COMPOSER_VERSION=1 PHP_VERSION=7.4 @@ -8,6 +8,7 @@ PHP_XDEBUG_3=1 REDIS_VERSION=5.0 WARDEN_DB=1 +WARDEN_DB_SYSTEM=mysql WARDEN_REDIS=1 ## Laravel Config diff --git a/environments/magento1/db.base.yml b/environments/magento1/db.mysql.base.yml similarity index 100% rename from environments/magento1/db.base.yml rename to environments/magento1/db.mysql.base.yml diff --git a/environments/magento1/init.env b/environments/magento1/init.env index 5b92aad6..76bc722c 100644 --- a/environments/magento1/init.env +++ b/environments/magento1/init.env @@ -1,9 +1,10 @@ WARDEN_DB=1 +WARDEN_DB_SYSTEM=mysql WARDEN_REDIS=1 -MYSQL_DISTRIBUTION=mariadb -MYSQL_DISTRIBUTION_VERSION=10.3 +DB_DISTRIBUTION=mariadb +DB_DISTRIBUTION_VERSION=10.3 NODE_VERSION=12 COMPOSER_VERSION=1 PHP_VERSION=7.2 @@ -18,4 +19,3 @@ BLACKFIRE_CLIENT_ID= BLACKFIRE_CLIENT_TOKEN= BLACKFIRE_SERVER_ID= BLACKFIRE_SERVER_TOKEN= - diff --git a/environments/magento2/db.base.yml b/environments/magento2/db.mysql.base.yml similarity index 100% rename from environments/magento2/db.base.yml rename to environments/magento2/db.mysql.base.yml diff --git a/environments/magento2/init.env b/environments/magento2/init.env index f60032c4..a575eef3 100644 --- a/environments/magento2/init.env +++ b/environments/magento2/init.env @@ -1,5 +1,6 @@ WARDEN_DB=1 +WARDEN_DB_SYSTEM=mysql WARDEN_ELASTICSEARCH=0 WARDEN_OPENSEARCH=1 WARDEN_ELASTICHQ=0 @@ -8,8 +9,8 @@ WARDEN_RABBITMQ=1 WARDEN_REDIS=1 OPENSEARCH_VERSION=2.5 -MYSQL_DISTRIBUTION=mariadb -MYSQL_DISTRIBUTION_VERSION=10.6 +DB_DISTRIBUTION=mariadb +DB_DISTRIBUTION_VERSION=10.6 NODE_VERSION=12 COMPOSER_VERSION=2.2 PHP_VERSION=8.1 @@ -34,4 +35,3 @@ BLACKFIRE_CLIENT_ID= BLACKFIRE_CLIENT_TOKEN= BLACKFIRE_SERVER_ID= BLACKFIRE_SERVER_TOKEN= - diff --git a/environments/shopware/db.base.yml b/environments/shopware/db.mysql.base.yml similarity index 100% rename from environments/shopware/db.base.yml rename to environments/shopware/db.mysql.base.yml diff --git a/environments/shopware/init.env b/environments/shopware/init.env index f0f867b2..bf255341 100644 --- a/environments/shopware/init.env +++ b/environments/shopware/init.env @@ -1,12 +1,13 @@ WARDEN_DB=1 +WARDEN_DB_SYSTEM=mysql WARDEN_REDIS=1 WARDEN_RABBITMQ=0 WARDEN_ELASTICSEARCH=0 WARDEN_VARNISH=0 -MYSQL_DISTRIBUTION=mariadb -MYSQL_DISTRIBUTION_VERSION=10.4 +DB_DISTRIBUTION=mariadb +DB_DISTRIBUTION_VERSION=10.4 NODE_VERSION=12 COMPOSER_VERSION=2 PHP_VERSION=7.4 @@ -14,4 +15,3 @@ PHP_XDEBUG_3=1 RABBITMQ_VERSION=3.8 REDIS_VERSION=5.0 VARNISH_VERSION=6.0 - diff --git a/environments/symfony/db.base.yml b/environments/symfony/db.mysql.base.yml similarity index 100% rename from environments/symfony/db.base.yml rename to environments/symfony/db.mysql.base.yml diff --git a/environments/symfony/db.postgres.base.yml b/environments/symfony/db.postgres.base.yml new file mode 100644 index 00000000..e06e574a --- /dev/null +++ b/environments/symfony/db.postgres.base.yml @@ -0,0 +1,7 @@ +version: "3.5" +services: + db: + environment: + - POSTGRES_PASSWORD=${DB_ROOT_PASSWORD:-symfony} + - POSTGRES_DB=${DB_DATABASE:-symfony} + - POSTGRES_USER=${DB_USER:-symfony} diff --git a/environments/symfony/init.env b/environments/symfony/init.env index f0f867b2..bf255341 100644 --- a/environments/symfony/init.env +++ b/environments/symfony/init.env @@ -1,12 +1,13 @@ WARDEN_DB=1 +WARDEN_DB_SYSTEM=mysql WARDEN_REDIS=1 WARDEN_RABBITMQ=0 WARDEN_ELASTICSEARCH=0 WARDEN_VARNISH=0 -MYSQL_DISTRIBUTION=mariadb -MYSQL_DISTRIBUTION_VERSION=10.4 +DB_DISTRIBUTION=mariadb +DB_DISTRIBUTION_VERSION=10.4 NODE_VERSION=12 COMPOSER_VERSION=2 PHP_VERSION=7.4 @@ -14,4 +15,3 @@ PHP_XDEBUG_3=1 RABBITMQ_VERSION=3.8 REDIS_VERSION=5.0 VARNISH_VERSION=6.0 - diff --git a/environments/wordpress/db.base.yml b/environments/wordpress/db.mysql.base.yml similarity index 100% rename from environments/wordpress/db.base.yml rename to environments/wordpress/db.mysql.base.yml diff --git a/environments/wordpress/init.env b/environments/wordpress/init.env index cf8c0218..6692fe67 100644 --- a/environments/wordpress/init.env +++ b/environments/wordpress/init.env @@ -1,12 +1,13 @@ -MYSQL_DISTRIBUTION=mariadb -MYSQL_DISTRIBUTION_VERSION=10.4 +DB_DISTRIBUTION=mariadb +DB_DISTRIBUTION_VERSION=10.4 NODE_VERSION=12 COMPOSER_VERSION=1 PHP_VERSION=7.4 PHP_XDEBUG_3=1 WARDEN_DB=1 +WARDEN_DB_SYSTEM=mysql WARDEN_REDIS=0 APP_ENV=local diff --git a/utils/env.sh b/utils/env.sh index 598021d6..000e9aad 100644 --- a/utils/env.sh +++ b/utils/env.sh @@ -134,6 +134,11 @@ function appendEnvPartialIfExists () { do if [[ -f "${PARTIAL_PATH}" ]]; then DOCKER_COMPOSE_ARGS+=("-f" "${PARTIAL_PATH}") + + if [[ "${PARTIAL_NAME}" = "db" ]]; then + echo -e "\033[33mWARNING\033[0m The 'db.base.yml' and 'db.${WARDEN_ENV_SUBT}.yml' files are deprecated." + echo -e "\033[33mWARNING\033[0m To resolve this rename them to 'db.mysql.base.yml' or 'db.mysql.${WARDEN_ENV_SBUT}.yml'." + fi fi done } From a40faf33c1bfe5260e0f27034556b89c1172e92b Mon Sep 17 00:00:00 2001 From: Brett Patterson Date: Sun, 25 Feb 2024 22:01:02 -0500 Subject: [PATCH 2/4] Fix default PostgreSQL version --- environments/includes/db.postgres.base.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/environments/includes/db.postgres.base.yml b/environments/includes/db.postgres.base.yml index 0ed7c802..9f4fb76f 100644 --- a/environments/includes/db.postgres.base.yml +++ b/environments/includes/db.postgres.base.yml @@ -6,7 +6,7 @@ services: db: hostname: "${WARDEN_ENV_NAME}-postgres" - image: ${WARDEN_IMAGE_REPOSITORY}/${DB_DISTRIBUTION:-postgres}:${DB_DISTRIBUTION_VERSION:-${DB_VERSION:-16.2}} + image: ${WARDEN_IMAGE_REPOSITORY}/${DB_DISTRIBUTION:-postgres}:${DB_DISTRIBUTION_VERSION:-${DB_VERSION:-16}} environment: - POSTGRES_PASSWORD=${DB_ROOT_PASSWORD:-app} - POSTGRES_DB=${DB_DATABASE:-app} From 989908c2f3bc4dfe541cfd28178780b43d688c1c Mon Sep 17 00:00:00 2001 From: Brett Patterson Date: Sun, 25 Feb 2024 22:09:50 -0500 Subject: [PATCH 3/4] Remove commented lines --- commands/db.mysql.cmd | 6 ------ commands/db.postgres.cmd | 6 ------ 2 files changed, 12 deletions(-) diff --git a/commands/db.mysql.cmd b/commands/db.mysql.cmd index 4fc991ad..13088522 100644 --- a/commands/db.mysql.cmd +++ b/commands/db.mysql.cmd @@ -1,12 +1,6 @@ #!/usr/bin/env bash [[ ! ${WARDEN_DIR} ]] && >&2 echo -e "\033[31mThis script is not intended to be run directly!\033[0m" && exit 1 -## load connection information for the mysql service -# DB_CONTAINER=$($WARDEN_BIN env ps -q db) -# if [[ ! ${DB_CONTAINER} ]]; then -# fatal "No container found for db service." -# fi - eval "$( docker container inspect ${DB_CONTAINER} --format ' {{- range .Config.Env }}{{with split . "=" -}} diff --git a/commands/db.postgres.cmd b/commands/db.postgres.cmd index 2e5f01d4..1621ce92 100644 --- a/commands/db.postgres.cmd +++ b/commands/db.postgres.cmd @@ -1,12 +1,6 @@ #!/usr/bin/env bash [[ ! ${WARDEN_DIR} ]] && >&2 echo -e "\033[31mThis script is not intended to be run directly!\033[0m" && exit 1 -## load connection information for the postgres service -# DB_CONTAINER=$($WARDEN_BIN env ps -q db) -# if [[ ! ${DB_CONTAINER} ]]; then -# fatal "No container found for db service." -# fi - eval "$( docker container inspect ${DB_CONTAINER} --format ' {{- range .Config.Env }}{{with split . "=" -}} From 9b840f5a7603fcc82de11d82261548546e90ce61 Mon Sep 17 00:00:00 2001 From: Brett Patterson Date: Sun, 25 Feb 2024 22:11:03 -0500 Subject: [PATCH 4/4] Enabling DB disablement check --- commands/db.cmd | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/commands/db.cmd b/commands/db.cmd index 98d35b15..fbbc88ac 100644 --- a/commands/db.cmd +++ b/commands/db.cmd @@ -5,9 +5,9 @@ WARDEN_ENV_PATH="$(locateEnvPath)" || exit $? loadEnvConfig "${WARDEN_ENV_PATH}" || exit $? assertDockerRunning -#if [[ ${WARDEN_DB:-1} -eq 0 ]]; then -# fatal "Database environment is not used (WARDEN_DB=0)." -#fi +if [[ ${WARDEN_DB:-1} -eq 0 ]]; then + fatal "Database environment is not used (WARDEN_DB=0)." +fi if (( ${#WARDEN_PARAMS[@]} == 0 )) || [[ "${WARDEN_PARAMS[0]}" == "help" ]]; then $WARDEN_BIN db --help || exit $? && exit $?