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

Update mariadb plugin #51

Merged
Merged
Show file tree
Hide file tree
Changes from all 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
1 change: 1 addition & 0 deletions .github/workflows/pr-symfony-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ jobs:
- examples/symfony-export
- examples/symfony-import
- examples/symfony-init
- examples/symfony-mariadb
- examples/symfony-mysql8
- examples/symfony-nginx
lando-version:
Expand Down
10 changes: 8 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,11 +1,17 @@
## {{ UNRELEASED_VERSION }} - [{{ UNRELEASED_DATE }}]({{ UNRELEASED_LINK }})

* Updated mariadb plugin [#51](https://github.com/lando/mariadb/issues/51)
* Cleaned up test comments

## v1.5.0 - [March 8, 2024](https://github.com/lando/symfony/releases/tag/v1.5.0)
* Updated to latest database services.

* Updated to latest database services.

## v1.4.1 - [March 4, 2024](https://github.com/lando/symfony/releases/tag/v1.4.1)

### Fixes

* Improved `database` selection for purposes of `config` loading, fixes some `database` bootup issues when the `database` type is overriden downstream
* Improved `database` selection for purposes of `config` loading, fixes some `database` bootup issues when the `database` type is overridden downstream

## v1.4.0 - [February 22, 2024](https://github.com/lando/symfony/releases/tag/v1.4.0)

Expand Down
20 changes: 18 additions & 2 deletions builders/symfony.js
Original file line number Diff line number Diff line change
Expand Up @@ -135,8 +135,10 @@ const getDbTooling = database => {
// Make sure we strip out any version number
database = database.split(':')[0];
// Choose wisely
if (_.includes(['mysql', 'mariadb'], database)) {
if (database === 'mysql') {
return {mysql: mysqlCli};
} else if (database === 'mariadb') {
return {mariadb: mariadbCli};
} else if (database === 'postgres') {
return {psql: postgresCli};
} else if (database === 'mongo') {
Expand All @@ -147,7 +149,20 @@ const getDbTooling = database => {
}
};

// Default DB cli commands
// MariaDB cli commands
const mariadbCli = {
service: ':host',
description: 'Drops into a MariaDB shell on a database service',
cmd: 'mariadb -uroot',
options: {
host: {
description: 'The database service to use',
default: 'database',
alias: ['h'],
},
},
};
// MySQL DB cli commands
const mysqlCli = {
service: ':host',
description: 'Drops into a MySQL shell on a database service',
Expand All @@ -160,6 +175,7 @@ const mysqlCli = {
},
},
};
// Postgres cli commands
const postgresCli = {
service: ':host',
description: 'Drops into a psql shell on a database service',
Expand Down
3 changes: 2 additions & 1 deletion docs/.vitepress/config.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -55,4 +55,5 @@ function sidebar() {
],
},
];
};
};

2 changes: 1 addition & 1 deletion examples/symfony-downstreamer-1/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ lando mysql -V | grep 8.0
# Should use the default database connection info
lando mysql -usymfony -psymfony symfony -e quit

# Should use the defauly mysql8 config file
# Should use the default mysql8 config file
lando ssh -s database -c "cat /opt/bitnami/mysql/conf/my_custom.cnf" | grep "LANDOSYMFONYMYSQL8CNF"
lando mysql -u root -e "show variables;" | grep innodb_lock_wait_timeout | grep 127
```
Expand Down
2 changes: 1 addition & 1 deletion examples/symfony-downstreamer-2/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ lando mysql -V | grep 8.0
# Should use the default database connection info
lando mysql -usymfony -psymfony symfony -e quit

# Should use the defauly mysql8 config file
# Should use the default mysql8 config file
lando ssh -s database -c "cat /opt/bitnami/mysql/conf/my_custom.cnf" | grep "LANDOSYMFONYMYSQL8CNF"
lando mysql -u root -e "show variables;" | grep innodb_lock_wait_timeout | grep 127
```
Expand Down
10 changes: 10 additions & 0 deletions examples/symfony-mariadb/.lando.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
name: symfony-mariadb
recipe: symfony
config:
webroot: web
php: 8.3
database: mariadb:11.3

# do not remove this
plugins:
"@lando/symfony": ../..
54 changes: 54 additions & 0 deletions examples/symfony-mariadb/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
# Symfony MariaDB Example

This example exists primarily to test the following documentation:

* [Symfony Recipe](https://docs.lando.dev/symfony/config.html)

Start up tests
--------------

Run the following commands to get up and running with this example.

```bash
# Should start up successfully
lando poweroff
lando start
```

Verification commands
---------------------

Run the following commands to validate things are rolling as they should.

```bash
# Should serve from web folder
lando ssh -s appserver -c "curl -L localhost" | grep "MariaDB"

# Should be running apache 2.4 by default
lando ssh -s appserver -c "apachectl -V | grep 2.4"
lando ssh -s appserver -c "curl -IL localhost" | grep Server | grep 2.4

# Should use php 8.3 if specified by user
lando php -v | grep "PHP 8.3."

# Should be running mariadb 11.3.x if specified by user
lando mariadb -V | grep "mariadb" | grep "11.3."

# Should be able to connect to the database with the default creds
lando mariadb symfony -e quit

# Should use the default mariadb config file
lando ssh -s database -c "cat /opt/bitnami/mariadb/conf/my_custom.cnf" | grep "innodb_lock_wait_timeout = 121"
lando mariadb -u root -e "show variables;" | grep innodb_lock_wait_timeout | grep 121
```

Destroy tests
-------------

Run the following commands to trash this app like nothing ever happened.

```bash
# Should be destroyed with success
lando destroy -y
lando poweroff
```
1 change: 1 addition & 0 deletions examples/symfony-mariadb/web/index.php
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
MariaDB
1 change: 1 addition & 0 deletions examples/symfony-mariadb/web/info.php
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
<?php phpinfo(); ?>
6 changes: 3 additions & 3 deletions examples/symfony-mysql8/README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Symfony MySQL 8Example
# Symfony MySQL 8 Example

This example exists primarily to test the following documentation:

Expand Down Expand Up @@ -31,13 +31,13 @@ lando ssh -s appserver -c "curl -IL localhost" | grep Server | grep 2.4
# Should use php 5.6 if specified by user
lando php -v | grep "PHP 5.6"

# Should be running mysql 8 if specified by user
# Should be running mysql8 if specified by user
lando mysql -V | grep "mysql"| grep "Ver 8.0.22"

# Should be able to connect to the database with the default creds
lando mysql symfony -e quit

# Should use the defauly mysql8 config file
# Should use the default mysql8 config file
lando ssh -s database -c "cat /opt/bitnami/mysql/conf/my_custom.cnf" | grep "LANDOSYMFONYMYSQL8CNF"
lando mysql -u root -e "show variables;" | grep innodb_lock_wait_timeout | grep 127
```
Expand Down
2 changes: 1 addition & 1 deletion examples/symfony-nginx/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ lando ssh -s appserver -c "curl -L appserver_nginx" | grep "NGINX"
# Should run using nginx if specified
lando ssh -s appserver -c "curl -IL appserver_nginx" | grep Server | grep nginx

# Should use nginx 1.25 by defualt
# Should use nginx 1.25 by default
lando nginx -v 2>&1 | grep "nginx version" | grep "nginx/1.25"

# Should use the php version specified by the user eg 7.4
Expand Down
Loading
Loading