|
1 | 1 | [](https://addons.ddev.com) |
2 | | -[](https://github.com/ddev/ddev-addon-template/actions/workflows/tests.yml?query=branch%3Amain) |
3 | | -[](https://github.com/ddev/ddev-addon-template/commits) |
4 | | -[](https://github.com/ddev/ddev-addon-template/releases/latest) |
| 2 | +[](https://github.com/stasadev/ddev-redis-insight/actions/workflows/tests.yml?query=branch%3Amain) |
| 3 | +[](https://github.com/stasadev/ddev-redis-insight/commits) |
| 4 | +[](https://github.com/stasadev/ddev-redis-insight/releases/latest) |
5 | 5 |
|
6 | | -# DDEV Add-on Template <!-- omit in toc --> |
| 6 | +# DDEV Redis Insight |
7 | 7 |
|
8 | | -* [What is DDEV Add-on Template?](#what-is-ddev-add-on-template) |
9 | | -* [TL;DR](#tldr) |
10 | | -* [Components of the repository](#components-of-the-repository) |
11 | | -* [Getting started](#getting-started) |
12 | | -* [How to debug in Github Actions](#how-to-debug-in-github-actions) |
13 | | -* [Resources](#resources) |
14 | | -* [Credits](#credits) |
| 8 | +## Overview |
15 | 9 |
|
16 | | -## What is DDEV Add-on Template? |
| 10 | +This add-on integrates Redis Insight into your [DDEV](https://ddev.com/) project. |
17 | 11 |
|
18 | | -This repository is a template for providing [DDEV](https://ddev.readthedocs.io) add-ons and services. |
| 12 | +## Installation |
19 | 13 |
|
20 | | -In DDEV, add-ons can be installed from the command line using the `ddev add-on get` command, for example, `ddev add-on get ddev/ddev-redis` or `ddev add-on get ddev/ddev-solr`. |
| 14 | +```bash |
| 15 | +ddev add-on get stasadev/ddev-redis-insight |
| 16 | +ddev restart |
| 17 | +``` |
21 | 18 |
|
22 | | -This repository is a quick way to get started. You can create a new repo from this one by clicking the template button in the top right corner of the page. |
| 19 | +After installation, make sure to commit the `.ddev` directory to version control. |
23 | 20 |
|
24 | | - |
| 21 | +## Usage |
25 | 22 |
|
26 | | -## TL;DR |
| 23 | +| Command | Description | |
| 24 | +| ------- | ----------- | |
| 25 | +| `ddev describe` | View service status and used ports for Redis Insight | |
| 26 | +| `ddev logs -s redis-insight` | Check Redis Insight logs | |
27 | 27 |
|
28 | | -1. Click the green `Use this template button` (top right) > `Create a new repository`. |
29 | | -2. Name your repository using the `ddev-` prefix (e.g. `ddev-foobar`). |
30 | | -3. Add a meaningful description with relevant keywords for discoverability. |
31 | | -4. Click `Create repository` and wait for the automated `First time setup` commit. |
| 28 | +## Advanced Customization |
32 | 29 |
|
33 | | -> [!NOTE] |
34 | | -> Automated updates to the `README.md` happen in a minute or so after creation. |
| 30 | +To change the Docker image: |
35 | 31 |
|
36 | | -5. Clone your repository locally (use the green `<> Code` button for the URL). |
37 | | -6. Prepare your add-on files and tests, see [Getting started](#getting-started) for details. |
38 | | -7. Create a new PR for review and discussion (avoid committing directly to `main`, as that bypasses the collaborative process). |
39 | | -8. Merge or squash your PR into `main` (squash is preferred for a cleaner commit history). |
40 | | -9. Create a new [release](https://docs.github.com/en/repositories/releasing-projects-on-github/managing-releases-in-a-repository). |
41 | | -10. When ready to share, make your add-on discoverable by adding the `ddev-get` [topic](https://docs.github.com/en/repositories/managing-your-repositorys-settings-and-features/customizing-your-repository/classifying-your-repository-with-topics). |
| 32 | +```bash |
| 33 | +ddev dotenv set .ddev/.env.redis-insight --redis-insight-docker-image="busybox:stable" |
| 34 | +ddev add-on get stasadev/ddev-redis-insight |
| 35 | +ddev restart |
| 36 | +``` |
42 | 37 |
|
43 | | -## Components of the repository |
| 38 | +Make sure to commit the `.ddev/.env.redis-insight` file to version control. |
44 | 39 |
|
45 | | -* The fundamental contents of the add-on service or other component. For example, in this template there is a [docker-compose.addon-template.yaml](docker-compose.addon-template.yaml) file. |
46 | | -* An [install.yaml](install.yaml) file that describes how to install the service or other component. |
47 | | -* A test suite in [test.bats](tests/test.bats) that makes sure the service continues to work as expected. |
48 | | -* [Github actions setup](.github/workflows/tests.yml) so that the tests run automatically when you push to the repository. |
| 40 | +All customization options (use with caution): |
49 | 41 |
|
50 | | -## Getting started |
51 | | - |
52 | | -1. Choose a good descriptive name for your add-on. It should probably start with "ddev-" and include the basic service or functionality. If it's particular to a specific CMS, perhaps `ddev-<CMS>-servicename`. |
53 | | -2. Create the new template repository by using the template button. |
54 | | -3. Add the files that need to be added to a DDEV project to the repository. If your add-on does not add a new service, remove `docker-compose.<addon-name>.yaml` file. |
55 | | -4. Update the `install.yaml` to give the necessary instructions for installing the add-on: |
56 | | - |
57 | | - * The fundamental line is the `project_files` directive, a list of files to be copied from this repo into the project `.ddev` directory. |
58 | | - * You can optionally add files to the `global_files` directive as well, which will cause files to be placed in the global `.ddev` directory, `~/.ddev`. |
59 | | - * Finally, `pre_install_commands` and `post_install_commands` are supported. These can use the host-side environment variables documented [in DDEV docs](https://ddev.readthedocs.io/en/stable/users/extend/custom-commands/#environment-variables-provided). |
60 | | - |
61 | | -5. Update `tests/test.bats` to provide a reasonable test for your repository. In most cases, you only need to modify the `health_checks()` function. Tests will run automatically on every push to the repository, and periodically each night. Please make sure to address test failures when they happen. Others will be depending on you. Bats is a testing framework that just uses Bash. To run a Bats test locally, you have to install [bats-core](https://bats-core.readthedocs.io/en/stable/installation.html) and its [libraries](https://github.com/ztombol/bats-docs) first. Then you download your add-on, and finally run `bats ./tests/test.bats` within the root of the uncompressed directory. To learn more about Bats see the [documentation](https://bats-core.readthedocs.io/en/stable/). |
62 | | -6. When everything is working, including the tests, you can push the repository to GitHub. |
63 | | -7. Create a [release](https://docs.github.com/en/repositories/releasing-projects-on-github/managing-releases-in-a-repository) on GitHub. |
64 | | -8. Test manually with `ddev add-on get <owner/repo>`. |
65 | | -9. You can test PRs with `ddev add-on get https://github.com/<user>/<repo>/tarball/<branch>` or `https://github.com/<user>/<repo>/tarball/refs/pull/<pr-number>/head`. |
66 | | -10. You can test add-ons locally without GitHub by downloading them, making changes and running `ddev add-on get /path/to/add-on-directory`. |
67 | | -11. Update the [`README.md`](./README_ADDON.md) to describe the add-on, how to use it, and how to contribute. If there are any manual actions that have to be taken, please explain them. If it requires special configuration of the using project, please explain how to do those. Examples in [ddev/ddev-solr](https://github.com/ddev/ddev-solr), [ddev/ddev-memcached](https://github.com/ddev/ddev-memcached), and (advanced) [ddev-platformsh](https://github.com/ddev/ddev-platformsh). |
68 | | -12. Add a good short description to your repo, and add the `ddev-get` [topic](https://docs.github.com/en/repositories/managing-your-repositorys-settings-and-features/customizing-your-repository/classifying-your-repository-with-topics). It will immediately be added to the list provided by `ddev add-on list --all`. |
69 | | -13. When it has matured you will hopefully want to have it become an "official" maintained add-on. Open an issue in the [DDEV queue](https://github.com/ddev/ddev/issues) for that. |
70 | | - |
71 | | -## How to debug in Github Actions |
72 | | - |
73 | | -See [full instructions](./README_DEBUG.md). |
74 | | - |
75 | | -## Resources |
76 | | - |
77 | | -* [DDEV Add-ons: Creating, maintaining, testing](https://www.youtube.com/watch?v=TmXqQe48iqE) (part of the [DDEV Contributor Live Training](https://ddev.com/blog/contributor-training)) |
78 | | -* [Advanced Add-On Techniques](https://ddev.com/blog/advanced-add-on-contributor-training/) |
79 | | -* [DDEV Add-on Maintenance Guide](https://ddev.com/blog/ddev-add-on-maintenance-guide/) |
80 | | -* [DDEV docs](https://ddev.readthedocs.io/en/stable/users/extend/additional-services/) |
81 | | -* [DDEV Add-on Registry](https://addons.ddev.com/) |
| 42 | +| Variable | Flag | Default | |
| 43 | +| -------- | ---- | ------- | |
| 44 | +| `REDIS_INSIGHT_DOCKER_IMAGE` | `--redis-insight-docker-image` | `busybox:stable` | |
82 | 45 |
|
83 | 46 | ## Credits |
84 | 47 |
|
85 | | -**Contributed and maintained by @CONTRIBUTOR** |
| 48 | +**Contributed and maintained by [@stasadev](https://github.com/stasadev)** |
0 commit comments