Skip to content
Closed
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/label-add-to-project.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ on:

jobs:
add_to_project:
runs-on: ubuntu-latest
runs-on: ubuntu-24.04
steps:
- name: Add issue/PR to GitHub Project
if: github.event.label.name == 'flag'
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/pr-docs-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ jobs:
os:
- ubuntu-24.04
node-version:
- '18'
- '20'
steps:
# Install deps and cache
- name: Checkout code
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 @@ -11,7 +11,7 @@ jobs:
os:
- ubuntu-24.04
node-version:
- '18'
- '20'
steps:
# Install deps and cache
- name: Checkout code
Expand Down
3 changes: 2 additions & 1 deletion .github/workflows/pr-phpmyadmin-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,13 @@ jobs:
leia-test:
- examples/4.x
- examples/5.x
- examples/mysql
lando-version:
- 3-edge-slim
os:
- ubuntu-24.04
node-version:
- '18'
- '20'
steps:

- name: Checkout code
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 @@ -13,7 +13,7 @@ jobs:
- ubuntu-24.04
- macos-14
node-version:
- '18'
- '20'
steps:
# Install deps and cache
- name: Checkout code
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -52,3 +52,4 @@ yarn.lock
.stignore
*.sync-conflict-*

phpmyadmin/
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
## {{ UNRELEASED_VERSION }} - [{{ UNRELEASED_DATE }}]({{ UNRELEASED_LINK }})

* Switched to official `phpmyadmin` Docker image for arm64/Apple Silicon support [#61](https://github.com/lando/phpmyadmin/issues/61)
* Modernized example tests with pinned database versions and added MySQL test coverage
* Updated `@lando/mariadb` test dependency to ^1.8.0
* Updated `@lando/mysql` test dependency to ^1.6.0
* Updated `vite` from 5.4.20 to 5.4.21
* Updated `mdast-util-to-hast` from 13.2.0 to 13.2.1
* Updated `lodash-es` from 4.17.21 to 4.17.23
Expand Down
13 changes: 11 additions & 2 deletions builders/phpmyadmin.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,12 +29,21 @@ module.exports = {

// Arrayify the hosts if needed
if (!_.isArray(options.hosts)) options.hosts = [options.hosts];

// Determine if this is a legacy version (< 5.0.0)
const isLegacy = semver.lt(`${options.version}.0`, '5.0.0');

// Switch to legacy command if needed
if (semver.lt(`${options.version}.0`, '5.0.0')) options.command = '/run.sh phpmyadmin';
if (isLegacy) options.command = '/run.sh phpmyadmin';

// Use official image for 5.x+, legacy image for 4.x
const image = isLegacy
? `phpmyadmin/phpmyadmin:${options.version}`
: `phpmyadmin:${options.version}`;

// Assemble the service config
const pmaService = {
image: `phpmyadmin/phpmyadmin:${options.version}`,
image,
environment: {
MYSQL_ROOT_PASSWORD: '',
PMA_HOSTS: options.hosts.join(','),
Expand Down
2 changes: 1 addition & 1 deletion docs/config.md
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ services:

## Advanced

There are also [several various envvars](https://hub.docker.com/r/phpmyadmin/phpmyadmin/) exposed by the underlying image we use that you can set to further customize how your PhpMyAdmin works. **These are not officially supported** so we *highly recommend* you do not alter them unless you know what you are doing. Even then, YMMV.
There are also [several various envvars](https://hub.docker.com/_/phpmyadmin) exposed by the underlying image we use that you can set to further customize how your PhpMyAdmin works. **These are not officially supported** so we *highly recommend* you do not alter them unless you know what you are doing. Even then, YMMV.

That said, you will need to use a [service override](https://docs.lando.dev/services/lando-3.html#overrides) to take advantage of them as shown below:

Expand Down
14 changes: 7 additions & 7 deletions docs/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,17 +18,17 @@ services:

## Supported versions

* [5.2](https://hub.docker.com/r/phpmyadmin/phpmyadmin/)
* [5.1](https://hub.docker.com/r/phpmyadmin/phpmyadmin/)
* [5.0](https://hub.docker.com/r/phpmyadmin/phpmyadmin/)
* [5.2](https://hub.docker.com/_/phpmyadmin)
* [5.1](https://hub.docker.com/_/phpmyadmin)
* [5.0](https://hub.docker.com/_/phpmyadmin)
* [custom](https://docs.lando.dev/services/lando-3.html#overrides)

## Legacy versions

* [4.9](https://hub.docker.com/r/phpmyadmin/phpmyadmin/)
* [4.8](https://hub.docker.com/r/phpmyadmin/phpmyadmin/)
* [4.7](https://hub.docker.com/r/phpmyadmin/phpmyadmin/)
* [4.6](https://hub.docker.com/r/phpmyadmin/phpmyadmin/)
* [4.9](https://hub.docker.com/r/phpmyadmin/phpmyadmin)
* [4.8](https://hub.docker.com/r/phpmyadmin/phpmyadmin)
* [4.7](https://hub.docker.com/r/phpmyadmin/phpmyadmin)
* [4.6](https://hub.docker.com/r/phpmyadmin/phpmyadmin)

## Patch versions

Expand Down
4 changes: 2 additions & 2 deletions examples/4.x/.lando.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,9 @@ services:
- chmod +x /app/.lando/pma-theme.sh
- /app/.lando/pma-theme.sh
database:
type: mariadb
type: mariadb:10.6
database2:
type: mariadb
type: mariadb:10.11

# This is important because it lets lando know to test against the plugin in this repo
# DO NOT REMOVE THIS!
Expand Down
10 changes: 5 additions & 5 deletions examples/4.x/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,17 +28,17 @@ Run the following commands to validate things are rolling as they should.

```bash
# Should return 200 for the pma admin site
lando ssh -s pma -c "curl -I localhost | grep 200 | grep OK"
lando exec pma -- curl -I localhost | grep 200 | grep OK

# Should have databases that work correctly
lando ssh -s database -c "mysql -umariadb -pmariadb database -e quit"
lando ssh -s database2 -c "mysql -umariadb -pmariadb database -e quit"
lando exec database -- mysql -umariadb -pmariadb database -e quit
lando exec database2 -- mysql -umariadb -pmariadb database -e quit

# Should have our databases hooked up to PMA
lando ssh -s pma -c "env | grep PMA_HOSTS=database,database2"
lando exec pma -- env | grep PMA_HOSTS=database,database2

# Should have set a custom config file if specified
lando ssh -s pma -c "cat /etc/phpmyadmin/config.user.inc.php" | grep ThemeDefault | grep pmaterial
lando exec pma -- cat /etc/phpmyadmin/config.user.inc.php | grep ThemeDefault | grep pmaterial
```

Destroy tests
Expand Down
2 changes: 1 addition & 1 deletion examples/4.x/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,6 @@
"author": "",
"license": "ISC",
"dependencies": {
"@lando/mariadb": "^1.0.0"
"@lando/mariadb": "^1.8.0"
}
}
5 changes: 3 additions & 2 deletions examples/5.x/.lando.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,12 +24,13 @@ services:
- chmod +x /app/.lando/pma-theme.sh
- /app/.lando/pma-theme.sh
database:
type: mariadb
type: mariadb:11.4
database2:
type: mariadb
type: mysql:8.0

# This is important because it lets lando know to test against the plugin in this repo
# DO NOT REMOVE THIS!
plugins:
"@lando/phpmyadmin": ./../../
"@lando/mariadb": ./node_modules/@lando/mariadb
"@lando/mysql": ./node_modules/@lando/mysql
10 changes: 8 additions & 2 deletions examples/5.x/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,15 +32,21 @@ lando exec defaults -- curl -I localhost | grep 200 | grep OK
lando exec pma -- curl -I localhost | grep 200 | grep OK
lando exec pma_theme -- curl -I localhost | grep 200 | grep OK

# Should have databases that work correctly
# Should have mariadb database that works correctly
lando exec database -- mysql -umariadb -pmariadb database -e quit
lando exec database2 -- mysql -umariadb -pmariadb database -e quit

# Should have mysql database that works correctly
lando exec database2 -- mysql -umysql -pmysql database -e quit

# Should have our databases hooked up to PMA
lando exec defaults -- env | grep PMA_HOSTS=database,database2
lando exec pma -- env | grep PMA_HOSTS=database,database2
lando exec pma_theme -- env | grep PMA_HOSTS=database,database2

# Should be able to connect to both database hosts from PMA
lando exec pma -- curl -s localhost | grep -q "database"
lando exec pma -- curl -s localhost | grep -q "database2"

# Should be version 5.1.x
lando exec defaults -- curl -s localhost | grep -oP '<span class="version">\K[^<]+' | tee >(cat 1>&2) | grep -q '5.1.'

Expand Down
3 changes: 2 additions & 1 deletion examples/5.x/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
"author": "",
"license": "ISC",
"dependencies": {
"@lando/mariadb": "^1.6.3"
"@lando/mariadb": "^1.8.0",
"@lando/mysql": "^1.6.0"
}
}
1 change: 1 addition & 0 deletions examples/mysql/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
node_modules
14 changes: 14 additions & 0 deletions examples/mysql/.lando.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
name: lando-pma-mysql
services:
pma:
type: phpmyadmin:5.2
hosts:
- database
database:
type: mysql:8.4

# This is important because it lets lando know to test against the plugin in this repo
# DO NOT REMOVE THIS!
plugins:
"@lando/phpmyadmin": ./../../
"@lando/mysql": ./node_modules/@lando/mysql
52 changes: 52 additions & 0 deletions examples/mysql/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
PhpMyAdmin MySQL Example
========================

This example exists primarily to test phpMyAdmin with MySQL specifically:

* [PhpMyAdmin Service](https://docs.devwithlando.io/tutorials/phpmyadmin.html)

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

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

```bash
# Should install Lando plugin dependency.
npm ci
```

```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 return 200 for the pma admin site
lando exec pma -- curl -I localhost | grep 200 | grep OK

# Should have mysql database that works correctly
lando exec database -- mysql -umysql -pmysql database -e quit

# Should have our database hooked up to PMA
lando exec pma -- env | grep PMA_HOSTS=database

# Should be version 5.2.x
lando exec pma -- curl -s localhost | grep -oP '<span class="version">\K[^<]+' | tee >(cat 1>&2) | grep -q '5.2.'
```

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
```
14 changes: 14 additions & 0 deletions examples/mysql/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
{
"name": "mysql",
"version": "1.0.0",
"description": "PhpMyAdmin MySQL Example",
"main": "index.js",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
},
"author": "",
"license": "ISC",
"dependencies": {
"@lando/mysql": "^1.6.0"
}
}
2 changes: 1 addition & 1 deletion netlify.toml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
[[context.deploy-preview.plugins]]
package = "netlify-plugin-checklinks"
[context.deploy-preview.plugins.inputs]
todoPatterns = [ "load", "CHANGELOG.html", "x.com", "twitter.com", "/v/" ]
todoPatterns = [ "load", "CHANGELOG.html", "x.com", "twitter.com", "/v/", "hub.docker.com" ]
skipPatterns = [ ".rss", ".gif", ".jpg" ]
checkExternal = true

Expand Down
42 changes: 42 additions & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,8 @@
"devDependencies": {
"@babel/eslint-parser": "^7.16.0",
"@lando/leia": "^1.0.0-beta.4",
"@lando/mariadb": "^1.8.0",
"@lando/mysql": "^1.6.0",
"@lando/vitepress-theme-default-plus": "^1.1.1",
"chai": "^4.3.4",
"command-line-test": "^1.0.10",
Expand Down
Loading