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 README.md, add check for db #35

Merged
merged 1 commit into from
Apr 1, 2025
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
5 changes: 5 additions & 0 deletions .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,11 @@

## Manual Testing Instructions

```bash
ddev add-on get https://github.com/<user>/<repo>/tarball/<branch>
ddev restart
```

## Automated Testing Overview

<!-- Please describe the tests introduced by this PR, or explain why no tests are needed. -->
Expand Down
61 changes: 38 additions & 23 deletions README.md
Original file line number Diff line number Diff line change
@@ -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://<project>.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://<project>.ddev.site:9101`) |
| `ddev describe` | View service status and used ports for Adminer |

## Advanced Customization

Expand All @@ -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/)**
2 changes: 1 addition & 1 deletion docker-compose.adminer_norouter.yaml
Original file line number Diff line number Diff line change
@@ -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: {}
18 changes: 12 additions & 6 deletions install.yaml
Original file line number Diff line number Diff line change
@@ -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:
- |
Expand All @@ -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:
- |
Expand Down