diff --git a/.github/PULL_REQUEST_TEMPLATE.md b/.github/PULL_REQUEST_TEMPLATE.md index cf38748..5d88d2a 100644 --- a/.github/PULL_REQUEST_TEMPLATE.md +++ b/.github/PULL_REQUEST_TEMPLATE.md @@ -8,6 +8,11 @@ ## Manual Testing Instructions +```bash +ddev add-on get https://github.com///tarball/ +ddev restart +``` + ## Automated Testing Overview diff --git a/README.md b/README.md index 3bcbac5..24b066e 100644 --- a/README.md +++ b/README.md @@ -1,22 +1,32 @@ -[![tests](https://github.com/ddev/ddev-adminer/actions/workflows/tests.yml/badge.svg)](https://github.com/ddev/ddev-adminer/actions/workflows/tests.yml) ![project is maintained](https://img.shields.io/maintenance/yes/2025.svg) +[![tests](https://github.com/ddev/ddev-adminer/actions/workflows/tests.yml/badge.svg?branch=main)](https://github.com/ddev/ddev-adminer/actions/workflows/tests.yml?query=branch%3Amain) +[![project is maintained](https://img.shields.io/maintenance/yes/2025.svg)](https://github.com/ddev/ddev-adminer/commits) +[![release](https://img.shields.io/github/v/release/ddev/ddev-adminer)](https://github.com/ddev/ddev-adminer/releases/latest) -# DDEV Adminer Service +# DDEV Adminer -## What is this? +## Overview -This repository allows you to quickly install the [Adminer](https://www.adminer.org/) database manager into a [DDEV](https://ddev.readthedocs.io) project using just `ddev add-on get ddev/ddev-adminer`. +[Adminer](https://www.adminer.org/) is a full-featured database management tool written in PHP. -Adminer is a full-featured database management tool written in PHP. This service currently ships the [official adminer container](https://hub.docker.com/_/adminer) with no _external_ plugins. +This add-on integrates Adminer into your [DDEV](https://ddev.com/) project. Adminer works with MySQL, MariaDB, PostgreSQL, SQLite, MS SQL, Oracle, and MongoDB. ## Installation ```sh -ddev add-on get ddev/ddev-adminer && ddev restart +ddev add-on get ddev/ddev-adminer +ddev restart ``` -Then you can just `ddev adminer` or use `ddev describe` to get the URL (`https://.ddev.site:9101`). +After installation, make sure to commit the `.ddev` directory to version control. + +## Usage + +| Command | Description | +| ------- | ----------- | +| `ddev adminer` | Open Adminer in your browser (`https://.ddev.site:9101`) | +| `ddev describe` | View service status and used ports for Adminer | ## Advanced Customization @@ -25,32 +35,37 @@ To change the design: ```sh # design: https://www.adminer.org/en/#extras ddev dotenv set .ddev/.env.adminer --adminer-design=dracula -git add .ddev/.env.adminer -ddev add-on get ddev/ddev-adminer && ddev restart +ddev add-on get ddev/ddev-adminer +ddev restart ``` +Make sure to commit the `.ddev/.env.adminer` file to version control. + To add more plugins: ```sh # plugins: https://www.adminer.org/en/plugins/ ddev dotenv set .ddev/.env.adminer --adminer-plugins="tables-filter edit-calendar" -git add .ddev/.env.adminer -ddev add-on get ddev/ddev-adminer && ddev restart +ddev add-on get ddev/ddev-adminer +ddev restart ``` -All possible customization options are listed below (avoid using them if you're unsure): +Make sure to commit the `.ddev/.env.adminer` file to version control. + +All customization options (use with caution): -- `--adminer-design` -- `--adminer-docker-image` -- `--adminer-default-driver` -- `--adminer-default-db` -- `--adminer-default-username` -- `--adminer-default-password` -- `--adminer-plugins` +| Variable | Flag | Default | +| -------- | ---- | ------- | +| `ADMINER_DEFAULT_DB` | `--adminer-default-db` | `db` | +| `ADMINER_DEFAULT_DRIVER` | `--adminer-default-driver` | `server` | +| `ADMINER_DEFAULT_PASSWORD` | `--adminer-default-password` | `db` | +| `ADMINER_DEFAULT_USERNAME` | `--adminer-default-username` | `db` | +| `ADMINER_DESIGN` | `--adminer-design` | `` | +| `ADMINER_DOCKER_IMAGE` | `--adminer-docker-image` | `adminer:standalone` | +| `ADMINER_PLUGINS` | `--adminer-plugins` | `tables-filter` | -## What does this add-on do? +## Credits -* Adds the adminer container as a service +**Contributed by [@bserem](https://github.com/bserem)** -**Contributed by [@bserem](https://github.com/bserem).** -**Maintained by DDEV team.** +**Maintained by the [DDEV team](https://ddev.com/support-ddev/)** diff --git a/docker-compose.adminer_norouter.yaml b/docker-compose.adminer_norouter.yaml index 09c267a..338f90b 100644 --- a/docker-compose.adminer_norouter.yaml +++ b/docker-compose.adminer_norouter.yaml @@ -1,4 +1,4 @@ #ddev-generated # If omit_containers[ddev-router] then this file will be replaced -# with another with a `ports` statement to directly expose port 8080 to 9100 +# with another with a 'ports' statement to directly expose port 8080 to 9100 services: {} diff --git a/install.yaml b/install.yaml index 10d5499..c10a908 100644 --- a/install.yaml +++ b/install.yaml @@ -1,12 +1,9 @@ name: adminer -# list of files and directories listed that are copied into project .ddev directory project_files: -- docker-compose.adminer.yaml -- docker-compose.adminer_norouter.yaml -- commands/host/adminer - -ddev_version_constraint: '>= v1.24.2' + - docker-compose.adminer.yaml + - docker-compose.adminer_norouter.yaml + - commands/host/adminer pre_install_actions: - | @@ -27,6 +24,15 @@ pre_install_actions: if [ "${has_old_files}" = true ]; then exit 2 fi + - | + #ddev-nodisplay + #ddev-description:Check for db service + if ddev debug configyaml 2>/dev/null | grep omit_containers | grep -q db; then + echo "Unable to install the add-on because no db service was found" + exit 3 + fi + +ddev_version_constraint: '>= v1.24.3' post_install_actions: - |