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

Pirog96 #42

Merged
merged 7 commits into from
Sep 6, 2024
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
2 changes: 1 addition & 1 deletion .github/workflows/pr-docs-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ jobs:
strategy:
matrix:
os:
- ubuntu-22.04
- ubuntu-24.04
node-version:
- '18'
steps:
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/pr-joomla-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,9 @@ jobs:
fail-fast: false
matrix:
lando-version:
- 3-dev-slim
- 3-edge-slim
os:
- ubuntu-22.04
- ubuntu-24.04
node-version:
- '18'
leia-test:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/pr-linter.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ jobs:
strategy:
matrix:
os:
- ubuntu-22.04
- ubuntu-24.04
node-version:
- '18'
steps:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/pr-unit-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ jobs:
matrix:
os:
- windows-2022
- ubuntu-22.04
- ubuntu-24.04
- macos-12
node-version:
- '18'
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ jobs:
strategy:
matrix:
os:
- ubuntu-22.04
- ubuntu-24.04
node-version:
- '18'
steps:
Expand Down
28 changes: 19 additions & 9 deletions .lando.yml
Original file line number Diff line number Diff line change
@@ -1,14 +1,24 @@
name: lando-joomla-plugin
name: docs.joomla
proxy:
cli:
- docs.joomla.lndo.site:5173
services:
node:
type: node:18
build:
- npm install
cli:
api: 4
image: node:18
command: sleep infinity
ports:
- 5173:5173/http
scanner: false
ssl: false
sslExpose: false
user: node
build:
app: |
npm install
tooling:
node:
service: node
service: cli
npm:
service: node
service: cli
vitepress:
service: cli
cmd: npx vitepress
14 changes: 11 additions & 3 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,14 +1,22 @@
## {{ UNRELEASED_VERSION }} - [{{ UNRELEASED_DATE }}]({{ UNRELEASED_LINK }})

* Use mysql command for MariaDB 10.3.x and below [#39](https://github.com/lando/joomla/issues/39)
## Bug Fixes

* Fixed bug causing default `proxy` settings to be clobbered by user specified ones
* Switched to `mysql` command for MariaDB 10.3.x and below [#39](https://github.com/lando/joomla/issues/39)

## Internal

* Updated DevOps to use new `lando exec`
* Updated `ubuntu` test runners to `24.04`

## v1.4.0 - [May 15, 2024](https://github.com/lando/joomla/releases/tag/v1.4.0)

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

## v1.3.0 - [March 8, 2024](https://github.com/lando/joomla/releases/tag/v1.3.0)

* Updated to latest database services.
* Updated to latest database services.

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

Expand Down
24 changes: 19 additions & 5 deletions builders/joomla.js
Original file line number Diff line number Diff line change
Expand Up @@ -184,6 +184,18 @@ const getDbTooling = database => {
}
};

/*
* Helper to get proxy config
*/
const getProxy = (options, proxyService = 'appserver') => {
// get any intial proxy stuff for proxyService
const urls = _.get(options, `_app.config.proxy.${proxyService}`, []);
// add
urls.push(`${options.app}.${options._app._config.domain}`);
// return
return {[proxyService]: _.uniq(_.compact(urls))};
};

/*
* Helper to get service config
*/
Expand Down Expand Up @@ -233,16 +245,18 @@ module.exports = {
// Add the joomla cli install command
options.composer['joomlatools/console'] = '*';

// Rebase on top of any default config we might already have
options.defaultFiles = _.merge({}, getConfigDefaults(_.cloneDeep(options)), options.defaultFiles);
options.services = _.merge({}, getServices(options), options.services);
options.tooling = _.merge({}, getTooling(options), options.tooling);
// Switch the proxy if needed
if (!_.has(options, 'proxyService')) {
if (_.startsWith(options.via, 'nginx')) options.proxyService = 'appserver_nginx';
else if (_.startsWith(options.via, 'apache')) options.proxyService = 'appserver';
}
options.proxy = _.set(options.proxy, options.proxyService, [`${options.app}.${options._app._config.domain}`]);

// Rebase on top of any default config we might already have
options.defaultFiles = _.merge({}, getConfigDefaults(_.cloneDeep(options)), options.defaultFiles);
options.proxy = _.merge({}, getProxy(options, options.proxyService), options.proxy);
options.services = _.merge({}, getServices(options), options.services);
options.tooling = _.merge({}, getTooling(options), options.tooling);

// Downstream
super(id, options);
};
Expand Down
Empty file removed examples/.gitkeep
Empty file.
2 changes: 0 additions & 2 deletions examples/.lando.local.yml

This file was deleted.

2 changes: 2 additions & 0 deletions examples/.lando.upstream.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
plugins:
"@lando/joomla": ../../..
3 changes: 3 additions & 0 deletions examples/.lando.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
name: placeholder
plugins:
"@lando/joomla": ..
3 changes: 3 additions & 0 deletions examples/joomla-custom/.lando.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
name: joomla-custom
proxy:
appserver_nginx:
- another.joomla-custom.lndo.site
recipe: joomla
config:
php: '8.3'
Expand Down
27 changes: 14 additions & 13 deletions examples/joomla-custom/README.md
Original file line number Diff line number Diff line change
@@ -1,11 +1,10 @@
# Joomla Custom 8Example
# Joomla Custom 8 Example

This example exists primarily to test the following documentation:

* [Joomla Recipe](https://docs.lando.dev/joomla/config.html)

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

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

Expand All @@ -15,24 +14,23 @@ lando poweroff
lando start
```

Verification commands
---------------------
## Verification commands

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

```bash
# Should serve from bob folder
lando ssh -s appserver -c "curl -L appserver_nginx" | grep "HI BOB"
lando exec appserver -- curl -L appserver_nginx | grep "HI BOB"

# Should be serving from nginx 1.17
lando ssh -s appserver_nginx -c "nginx -v" 2>&1 | grep "nginx version" | grep "nginx/1.17"
lando ssh -s appserver -c "curl -IL appserver_nginx" | grep Server | grep nginx
lando exec appserver_nginx -- nginx -v 2>&1 | grep "nginx version" | grep "nginx/1.17"
lando exec appserver -- curl -IL appserver_nginx | grep Server | grep nginx

# Should use php 8.3
lando php -v | grep "PHP 8.3"

# Should use composer 2.0.7
lando ssh -s appserver -c "/bin/sh -c 'NO_COLOR=1 composer -V'" | grep "Composer version 2.0.7"
lando exec appserver -- /bin/sh -c 'NO_COLOR=1 composer -V' | grep "Composer version 2.0.7"

# Should be running mysql 5.7
lando mysql -V | grep "mysql" | grep "Distrib 5.7."
Expand All @@ -43,14 +41,17 @@ lando mysql joomla -e quit
# Should have xdebug enabled
lando php -m | grep Xdebug

# Should have proxy urls present in lando info
lando info | grep "http://joomla-custom.lndo.site"
lando info | grep "http://another.joomla-custom.lndo.site"

# Should be using custom config files
lando ssh -s appserver -c "curl -L appserver_nginx/info.php" | grep memory_limit | grep 513M
lando ssh -s appserver_nginx -c "cat /opt/bitnami/nginx/conf/vhosts/lando.conf" | grep server_name | grep pirog
lando exec appserver -- curl -L appserver_nginx/info.php | grep memory_limit | grep 513M
lando exec appserver_nginx -- cat /opt/bitnami/nginx/conf/vhosts/lando.conf | grep server_name | grep pirog
lando mysql -u root -e "show variables;" | grep thread_cache_size | grep 12
```

Destroy tests
-------------
## Destroy tests

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

Expand Down
25 changes: 11 additions & 14 deletions examples/joomla-defaults/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,7 @@ This example exists primarily to test the following documentation:

* [Joomla Recipe](https://docs.lando.dev/joomla/config.html)

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

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

Expand All @@ -15,24 +14,23 @@ lando poweroff
lando start
```

Verification commands
---------------------
## Verification commands

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

```bash
# Should serve from app root by default
lando ssh -s appserver -c "curl -L localhost" | grep "DEFAULTS"
lando exec appserver -- curl -L localhost | grep "DEFAULTS"

# Should use 7.4 as the default php version
lando php -v | grep "PHP 7.4"

# 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
lando exec appserver -- apachectl -V | grep 2.4
lando exec appserver -- curl -IL localhost | grep Server | grep 2.4

# Should be running mysql 5.7 by default
lando mysql -V | grep 5.7
lando mysql -V | grep 5.7

# Should not enable xdebug by default
lando php -m | grep xdebug || echo $? | grep 1
Expand All @@ -41,17 +39,16 @@ lando php -m | grep xdebug || echo $? | grep 1
lando mysql joomla -e quit

# Should use composer 2 by default
lando ssh -s appserver -c "/bin/sh -c 'NO_COLOR=1 composer -V'" | grep "Composer version 2."
lando exec appserver -- /bin/sh -c 'NO_COLOR=1 composer -V' | grep "Composer version 2."

# Should use the correct default config files
lando ssh -s appserver -c "cat /usr/local/etc/php/conf.d/zzz-lando-my-custom.ini" | grep "; LANDOJOOMLAPHPINI"
lando ssh -s appserver -c "curl -L http://localhost/info.php" | grep max_execution_time | grep 91
lando ssh -s database -c "cat /opt/bitnami/mysql/conf/my_custom.cnf" | grep "LANDOJOOMLAMYSQLCNF"
lando exec appserver -- cat /usr/local/etc/php/conf.d/zzz-lando-my-custom.ini | grep "; LANDOJOOMLAPHPINI"
lando exec appserver -- curl -L http://localhost/info.php | grep max_execution_time | grep 91
lando exec database -- cat /opt/bitnami/mysql/conf/my_custom.cnf | grep "LANDOJOOMLAMYSQLCNF"
lando mysql -u root -e "show variables;" | grep innodb_lock_wait_timeout | grep 121
```

Destroy tests
-------------
## Destroy tests

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

Expand Down
11 changes: 4 additions & 7 deletions examples/joomla-downstreamer-1/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,7 @@ This example exists primarily to test the following documentation:

* [Joomla Recipe](https://docs.lando.dev/joomla/config.html)

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

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

Expand All @@ -15,8 +14,7 @@ lando poweroff
lando start
```

Verification commands
---------------------
## Verification commands

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

Expand All @@ -28,12 +26,11 @@ lando mysql -V | grep 8.0
lando mysql -ujoomla -pjoomla joomla -e quit

# Should use the defauly mysql8 config file
lando ssh -s database -c "cat /opt/bitnami/mysql/conf/my_custom.cnf" | grep "LANDOJOOMLAMYSQL8CNF"
lando exec database -- cat /opt/bitnami/mysql/conf/my_custom.cnf | grep "LANDOJOOMLAMYSQL8CNF"
lando mysql -u root -e "show variables;" | grep innodb_lock_wait_timeout | grep 127
```

Destroy tests
-------------
## Destroy tests

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

Expand Down
11 changes: 4 additions & 7 deletions examples/joomla-downstreamer-2/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,7 @@ This example exists primarily to test the following documentation:

* [Joomla Recipe](https://docs.lando.dev/joomla/config.html)

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

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

Expand All @@ -15,8 +14,7 @@ lando poweroff
lando start
```

Verification commands
---------------------
## Verification commands

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

Expand All @@ -28,12 +26,11 @@ lando mysql -V | grep 8.0
lando mysql -ujoomla -pjoomla joomla -e quit

# Should use the defauly mysql8 config file
lando ssh -s database -c "cat /opt/bitnami/mysql/conf/my_custom.cnf" | grep "LANDOJOOMLAMYSQL8CNF"
lando exec database -- cat /opt/bitnami/mysql/conf/my_custom.cnf | grep "LANDOJOOMLAMYSQL8CNF"
lando mysql -u root -e "show variables;" | grep innodb_lock_wait_timeout | grep 127
```

Destroy tests
-------------
## Destroy tests

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

Expand Down
Loading
Loading