Skip to content
This repository was archived by the owner on Nov 7, 2025. It is now read-only.

Commit 1033733

Browse files
authored
Initial commit
0 parents  commit 1033733

18 files changed

+1133
-0
lines changed

.gitattributes

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
# Exclude files from releases/tarballs
2+
tests/ export-ignore
3+
.github/ export-ignore
4+
.gitattributes export-ignore
Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
name: 🐞 Bug report or Support Request
2+
description: Create a report to help us improve.
3+
labels: [bug]
4+
body:
5+
- type: checkboxes
6+
attributes:
7+
label: Preliminary checklist
8+
description: Please complete the following checks before submitting an issue.
9+
options:
10+
- label: I am using the latest stable version of DDEV
11+
required: true
12+
- label: I am using the latest stable version of this add-on
13+
required: true
14+
- type: textarea
15+
attributes:
16+
label: Expected Behavior
17+
description: What did you expect to happen?
18+
validations:
19+
required: true
20+
- type: textarea
21+
attributes:
22+
label: Actual Behavior
23+
description: What actually happened instead?
24+
validations:
25+
required: true
26+
- type: textarea
27+
attributes:
28+
label: Steps To Reproduce
29+
description: Specific steps to reproduce the behavior.
30+
placeholder: |
31+
1. In this environment...
32+
2. With this config...
33+
3. Run `...`
34+
4. See error...
35+
validations:
36+
required: false
37+
- type: textarea
38+
attributes:
39+
label: Anything else?
40+
description: |
41+
Links? References? Screenshots? Anything that will give us more context about your issue!
42+
43+
💡 Attach images or log files by clicking this area to highlight it and dragging files in.
44+
validations:
45+
required: false
Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
name: 🚀 Feature request
2+
description: Suggest an idea for this project.
3+
labels: [enhancement]
4+
body:
5+
- type: checkboxes
6+
attributes:
7+
label: Is there an existing issue for this?
8+
description: Please search existing issues to see if one already exists for your request.
9+
options:
10+
- label: I have searched the existing issues
11+
required: true
12+
- type: textarea
13+
attributes:
14+
label: Is your feature request related to a problem?
15+
description: Clearly and concisely describe the problem. (Ex. I'm always frustrated when...)
16+
validations:
17+
required: true
18+
- type: textarea
19+
attributes:
20+
label: Describe your solution
21+
description: Clearly and concisely describe what you want to happen.
22+
validations:
23+
required: true
24+
- type: textarea
25+
attributes:
26+
label: Describe alternatives
27+
description: Clearly and concisely describe any alternative solutions or features you've considered.
28+
validations:
29+
required: false
30+
- type: textarea
31+
attributes:
32+
label: Additional context
33+
description: Add any other context or screenshots about the feature request.
34+
validations:
35+
required: false

.github/PULL_REQUEST_TEMPLATE.md

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
## The Issue
2+
3+
- Fixes #REPLACE_ME_WITH_RELATED_ISSUE_NUMBER
4+
5+
<!-- Provide a brief description of the issue. -->
6+
7+
## How This PR Solves The Issue
8+
9+
<!-- Describe the key change(s) in this PR that address the issue above. -->
10+
11+
## Manual Testing Instructions
12+
13+
<!-- If this PR changes logic, consider adding additional steps or context to the instructions below. -->
14+
15+
```bash
16+
ddev add-on get https://github.com/ddev/ddev-addon-template/tarball/refs/pull/REPLACE_ME_WITH_THIS_PR_NUMBER/head
17+
ddev restart
18+
```
19+
20+
## Automated Testing Overview
21+
22+
<!-- Please describe the tests introduced by this PR, or explain why no tests are needed. -->
23+
24+
## Release/Deployment Notes
25+
26+
<!-- Does this affect anything else or have ramifications for other code? Does anything have to be done on deployment? -->
Lines changed: 74 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,74 @@
1+
#!/usr/bin/env bash
2+
3+
set -o errexit
4+
set -o nounset
5+
set -o pipefail
6+
7+
GITHUB_REPOSITORY=${1?Error: Please pass repo org/name, e.g. ddev/ddev-addon-name}
8+
9+
# Extract variables
10+
FULL_REPO_NAME="$GITHUB_REPOSITORY"
11+
REPO_NAME="${GITHUB_REPOSITORY##*/}"
12+
USER_NAME="${GITHUB_REPOSITORY%%/*}"
13+
REPLACE_UNDERSCORES=${REPO_NAME//_/-}
14+
NO_PREFIX_NAME="${REPLACE_UNDERSCORES#ddev-}"
15+
LOWERCASE_NAME="${NO_PREFIX_NAME,,}"
16+
ENV_VAR_NAME=$(echo "${LOWERCASE_NAME//-/_}_DOCKER_IMAGE" | tr '[:lower:]' '[:upper:]')
17+
PRETTY_NAME=$(echo "$LOWERCASE_NAME" | sed 's/-/ /g' | awk '{for(i=1;i<=NF;i++) $i=toupper(substr($i,1,1)) substr($i,2)} 1')
18+
19+
update_readme() {
20+
mv README_ADDON.md README.md
21+
22+
sed -i "s|ddev/ddev-addon-template|$FULL_REPO_NAME|g" README.md
23+
sed -i "s|addon-template|$LOWERCASE_NAME|g" README.md
24+
sed -i "s|Add-on Template|$PRETTY_NAME|g" README.md
25+
sed -i "s|ADDON_TEMPLATE_DOCKER_IMAGE|$ENV_VAR_NAME|g" README.md
26+
sed -i "s|@CONTRIBUTOR|\[@$USER_NAME\](https://github.com/$USER_NAME)|g" README.md
27+
}
28+
29+
update_docker_compose() {
30+
local old_file="docker-compose.addon-template.yaml"
31+
local new_file="docker-compose.$LOWERCASE_NAME.yaml"
32+
mv "$old_file" "$new_file"
33+
34+
sed -i "s|addon-template|$LOWERCASE_NAME|g" "$new_file"
35+
sed -i "s|ADDON_TEMPLATE_DOCKER_IMAGE|$ENV_VAR_NAME|g" "$new_file"
36+
}
37+
38+
update_tests_and_templates() {
39+
sed -i "s|ddev/ddev-addon-template|$FULL_REPO_NAME|g" tests/test.bats
40+
sed -i "s|ddev/ddev-addon-template|$FULL_REPO_NAME|g" .github/PULL_REQUEST_TEMPLATE.md
41+
}
42+
43+
update_license() {
44+
sed -i "s|Copyright \[yyyy\]|Copyright $(date +'%Y')|g" LICENSE
45+
}
46+
47+
create_install_yaml() {
48+
cat <<EOF > install.yaml
49+
name: $LOWERCASE_NAME
50+
51+
project_files:
52+
- docker-compose.$LOWERCASE_NAME.yaml
53+
54+
ddev_version_constraint: '>= v1.24.3'
55+
EOF
56+
}
57+
58+
cleanup_files() {
59+
rm -f README_DEBUG.md
60+
rm -f .github/workflows/first-time-setup.yml
61+
rm -rf images
62+
rm -rf .github/scripts
63+
}
64+
65+
main() {
66+
update_readme
67+
update_docker_compose
68+
update_tests_and_templates
69+
update_license
70+
create_install_yaml
71+
cleanup_files
72+
}
73+
74+
main

0 commit comments

Comments
 (0)