You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
*[What is DDEV add-on template?](#what-is-ddev-add-on-template)
8
+
*[What is DDEV Add-on Template?](#what-is-ddev-add-on-template)
9
+
*[TL;DR](#tldr)
9
10
*[Components of the repository](#components-of-the-repository)
10
11
*[Getting started](#getting-started)
11
-
*[How to debug in Github Actions](./README_DEBUG.md)
12
+
*[How to debug in Github Actions](#how-to-debug-in-github-actions)
13
+
*[Resources](#resources)
14
+
*[Credits](#credits)
12
15
13
-
## What is DDEV add-on template?
16
+
## What is DDEV Add-on Template?
14
17
15
18
This repository is a template for providing [DDEV](https://ddev.readthedocs.io) add-ons and services.
16
19
@@ -20,6 +23,23 @@ This repository is a quick way to get started. You can create a new repo from th
20
23
21
24

22
25
26
+
## TL;DR
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.
32
+
33
+
> [!NOTE]
34
+
> Automated updates to the `README.md` happen in a minute or so after creation.
35
+
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).
42
+
23
43
## Components of the repository
24
44
25
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.
@@ -31,27 +51,35 @@ This repository is a quick way to get started. You can create a new repo from th
31
51
32
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`.
33
53
2. Create the new template repository by using the template button.
34
-
3. Globally replace "addon-template" with the name of your add-on.
35
-
4. Add the files that need to be added to a DDEV project to the repository. For example, you might replace `docker-compose.addon-template.yaml` with the `docker-compose.*.yaml` for your recipe.
36
-
5. Update the `install.yaml` to give the necessary instructions for installing the add-on:
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:
37
56
38
57
* The fundamental line is the `project_files` directive, a list of files to be copied from this repo into the project `.ddev` directory.
39
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`.
40
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).
41
60
42
-
6. Update `tests/test.bats` to provide a reasonable test for your repository. 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/).
43
-
7. When everything is working, including the tests, you can push the repository to GitHub.
44
-
8. Create a [release](https://docs.github.com/en/repositories/releasing-projects-on-github/managing-releases-in-a-repository) on GitHub.
45
-
9. Test manually with `ddev add-on get <owner/repo>`.
46
-
10. You can test PRs with `ddev add-on get https://github.com/<user>/<repo>/tarball/<branch>`.
47
-
11. You can test add-ons locally without GitHub by downloading them, making changes and running `ddev add-on get /path/to/add-on-directory`.
48
-
12. Update the `README.md` header, adding the machine name of the add-on, for example `# ddev-redis`, not `# DDEV Redis`.
49
-
13. Update the `README.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).
50
-
14. Add a good short description to your repo, and add the [topic](https://docs.github.com/en/repositories/managing-your-repositorys-settings-and-features/customizing-your-repository/classifying-your-repository-with-topics) "ddev-get". It will immediately be added to the list provided by `ddev add-on list --all`.
51
-
15. 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.
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
52
76
53
-
Add-ons were covered in [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)).
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))
Note that more advanced techniques are discussed in [Advanced Add-On Techniques](https://ddev.com/blog/advanced-add-on-contributor-training/) and [DDEV docs](https://ddev.readthedocs.io/en/stable/users/extend/additional-services/).
0 commit comments