Skip to content

Commit

Permalink
fix: make ddev phpmyadmin work again for Gitpod, fixes #15 (#16)
Browse files Browse the repository at this point in the history
* Fix `ddev phpmyadmin` for Gitpod

* Rename to _norouter.yaml
  • Loading branch information
stasadev authored Jul 15, 2024
1 parent 4a9fd7c commit 440c403
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 9 deletions.
18 changes: 14 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,22 @@

## What is ddev-phpmyadmin?

This add-on provides a phpMyAdmin service for [DDEV](https://github.com/ddev/ddev/).
This add-on provides a phpMyAdmin service for [DDEV](https://github.com/ddev/ddev/).

In DDEV v1.22+ phpMyAdmin will not be provided by default, but can be added with this add-on:
In DDEV v1.22+ phpMyAdmin is not provided by default, but it can be added with this add-on:

`ddev get ddev/ddev-phpmyadmin`
```
ddev get ddev/ddev-phpmyadmin
ddev restart
```

You can run phpMyAdmin easily with the command `ddev phpmyadmin` after installing this add-on.
You can run phpMyAdmin easily with the command after installing this add-on:

```
ddev phpmyadmin
```

> [!TIP]
> For Gitpod: The `ddev phpmyadmin` command can open a blank page in preview mode, open the link in a new browser tab/window to make it work.
**Contributed and maintained by [@rfay](https://github.com/rfay)**
6 changes: 3 additions & 3 deletions commands/host/phpmyadmin
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@
DDEV_PHPMYADMIN_PORT=8036
DDEV_PHPMYADMIN_HTTPS_PORT=8037

if [ ${DDEV_PRIMARY_URL%://*} = "https" ]; then
ddev launch $DDEV_PRIMARY_URL:$DDEV_PHPMYADMIN_HTTPS_PORT
else
if [ ${DDEV_PRIMARY_URL%://*} = "http" ] || [ -n "${GITPOD_WORKSPACE_ID:-}" ] || [ "${CODESPACES:-}" = "true" ]; then
ddev launch $DDEV_PRIMARY_URL:$DDEV_PHPMYADMIN_PORT
else
ddev launch $DDEV_PRIMARY_URL:$DDEV_PHPMYADMIN_HTTPS_PORT
fi
File renamed without changes.
4 changes: 2 additions & 2 deletions install.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ name: phpmyadmin

project_files:
- docker-compose.phpmyadmin.yaml
- docker-compose.phpmyadmin-norouter.yaml
- docker-compose.phpmyadmin_norouter.yaml
- commands/host/phpmyadmin

pre_install_actions:
Expand All @@ -19,7 +19,7 @@ post_install_actions:
#ddev-description:If router disabled, directly expose port
#
if ( {{ contains "ddev-router" (list .DdevGlobalConfig.omit_containers | toString) }} ); then
printf "#ddev-generated\nservices:\n phpmyadmin:\n ports:\n - 8036:80\n" > docker-compose.phpmyadmin-norouter.yaml
printf "#ddev-generated\nservices:\n phpmyadmin:\n ports:\n - 8036:80\n" > docker-compose.phpmyadmin_norouter.yaml
fi
- |
echo "You can now use 'ddev phpmyadmin' to launch PhpMyAdmin"
Expand Down

0 comments on commit 440c403

Please sign in to comment.