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

Move from MYSQL_DISTRIBUTION -> DB_DISTRIBUTION #665

Closed
wants to merge 3 commits into from
Closed
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 6 additions & 3 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,12 @@
# 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.13.1..develop)
-->
[All Commits](https://github.com/davidalger/warden/compare/0.14.0..main)

**Enhancements**
* Changed `MYSQL_DISTRIBUTION_` variables to `DB_DISTRIBUTION_` with backwards-compatible support for the old format

## Version [0.14.0](https://github.com/wardenenv/warden/tree/0.14.0) (2023-06-19)
[All Commits](https://github.com/wardenenv/warden/compare/0.13.1..0.14.0)

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

DB_DISTRIBUTION=${DB_DISTRIBUTION:-${MYSQL_DISTRIBUTION:-"mariadb"}}
DB_DISTRIBUTION_VERSION=${DB_DISTRIBUTION_VERSION:-${MYSQL_DISTRIBUTION_VERSION:-${MARIADB_VERSION:-"10.4"}}}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  1. shoudln't we add export there?
Suggested change
DB_DISTRIBUTION=${DB_DISTRIBUTION:-${MYSQL_DISTRIBUTION:-"mariadb"}}
DB_DISTRIBUTION_VERSION=${DB_DISTRIBUTION_VERSION:-${MYSQL_DISTRIBUTION_VERSION:-${MARIADB_VERSION:-"10.4"}}}
export DB_DISTRIBUTION=${DB_DISTRIBUTION:-${MYSQL_DISTRIBUTION:-"mariadb"}}
export DB_DISTRIBUTION_VERSION=${DB_DISTRIBUTION_VERSION:-${MYSQL_DISTRIBUTION_VERSION:-${MARIADB_VERSION:-"10.4"}}}
  1. maybe it's better to pring some warning if the DB_DISTRIBUTION and DB_DISTRIBUTION_VERSION variable aren't declared yet? In this case we might suggest changing MYSQL_DISTRIBUTION variable to DB_DISTRIBUTION and MYSQL_DISTRIBUTION_VERSION to DB_DISTRIBUTION_VERSION. What do you think?

Copy link
Member Author

@navarr navarr Jul 7, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't exactly follow point 2.

Warden's old default is MariaDB 10.4. A few versions ago I mistakenly introduced the ability to change database distribution and version using MYSQL_ variables (the mistake)

Moving to DB_DISTRIBUTION so it matches Den is what I'm trying to do here, while maintaining backwards compatibility with any .env file that uses MYSQL_ variables, and maintaining backwards compatibility with the original defaults


## allow return codes from sub-process to bubble up normally
trap '' ERR

Expand Down
2 changes: 1 addition & 1 deletion environments/includes/db.base.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ services:

db:
hostname: "${WARDEN_ENV_NAME}-mariadb"
image: ${WARDEN_IMAGE_REPOSITORY}/${MYSQL_DISTRIBUTION:-mariadb}:${MYSQL_DISTRIBUTION_VERSION:-${MARIADB_VERSION:-10.4}}
image: ${WARDEN_IMAGE_REPOSITORY}/${DB_DISTRIBUTION}:${DB_DISTRIBUTION_VERSION}}

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Extra bracket causes build issues.

image: ${WARDEN_IMAGE_REPOSITORY}/${DB_DISTRIBUTION}:${DB_DISTRIBUTION_VERSION}

environment:
- MYSQL_ROOT_PASSWORD=${MYSQL_ROOT_PASSWORD:-app}
- MYSQL_DATABASE=${MYSQL_DATABASE:-app}
Expand Down
4 changes: 2 additions & 2 deletions environments/laravel/init.env
Original file line number Diff line number Diff line change
@@ -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
Expand Down
4 changes: 2 additions & 2 deletions environments/magento1/init.env
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
WARDEN_DB=1
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
Expand Down
4 changes: 2 additions & 2 deletions environments/magento2/init.env
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,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
Expand Down
2 changes: 1 addition & 1 deletion environments/magento2/magento2.splitdb.checkout.base.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ services:

checkoutdb:
hostname: "${WARDEN_ENV_NAME}-checkoutdb"
image: ${WARDEN_IMAGE_REPOSITORY}/${MYSQL_DISTRIBUTION:-mariadb}:${MYSQL_DISTRIBUTION_VERSION:-${MARIADB_VERSION:-10.4}}
image: ${WARDEN_IMAGE_REPOSITORY}/${DB_DISTRIBUTION}:${DB_DISTRIBUTION_VERSION}}

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Extra bracket causes build issues.

environment:
- MYSQL_ROOT_PASSWORD=${MYSQL_ROOT_PASSWORD:-magento}
- MYSQL_DATABASE=${MYSQL_DATABASE:-magento}
Expand Down
2 changes: 1 addition & 1 deletion environments/magento2/magento2.splitdb.sales.base.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ services:

salesdb:
hostname: "${WARDEN_ENV_NAME}-salesdb"
image: ${WARDEN_IMAGE_REPOSITORY}/${MYSQL_DISTRIBUTION:-mariadb}:${MYSQL_DISTRIBUTION_VERSION:-${MARIADB_VERSION:-10.4}}
image: ${WARDEN_IMAGE_REPOSITORY}/${DB_DISTRIBUTION}:${DB_DISTRIBUTION_VERSION}}

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Extra bracket causes build issues.

environment:
- MYSQL_ROOT_PASSWORD=${MYSQL_ROOT_PASSWORD:-magento}
- MYSQL_DATABASE=${MYSQL_DATABASE:-magento}
Expand Down
2 changes: 1 addition & 1 deletion environments/magento2/magento2.tests.base.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ version: "3.5"
services:
tmp-mysql:
hostname: "${WARDEN_ENV_NAME}-mysql"
image: ${WARDEN_IMAGE_REPOSITORY}/${MYSQL_DISTRIBUTION:-mariadb}:${MYSQL_DISTRIBUTION_VERSION:-${MARIADB_VERSION:-10.4}}
image: ${WARDEN_IMAGE_REPOSITORY}/${DB_DISTRIBUTION}:${DB_DISTRIBUTION_VERSION}}

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Extra bracket causes build issues.

environment:
- MYSQL_ROOT_PASSWORD=${MYSQL_ROOT_PASSWORD:-magento}
- MYSQL_DATABASE=magento_integration_tests
Expand Down
4 changes: 2 additions & 2 deletions environments/shopware/init.env
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ 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
Expand Down
4 changes: 2 additions & 2 deletions environments/symfony/init.env
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ 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
Expand Down
4 changes: 2 additions & 2 deletions environments/wordpress/init.env
Original file line number Diff line number Diff line change
@@ -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
Expand Down