Skip to content

Commit 488ffd8

Browse files
committed
feat: architect dynamic configuration and expand django ecosystem
* Introduced JSON Schemas for rigorous validation of fragments and stacks, ensuring structure consistency and enabling IDE auto-complete. * Refactored fragment structure by lifting `env_file`, `restart`, and `depends_on` from the base `.yml` into dynamic runtime CLI injections, minimizing boiler-plate. * Added intelligent environment generation that dynamically routes variables to `.env.compose` and `.env` (commented out by default) based on `env_file_vars` fragment schema flags. * Implemented new global configuration options (`~/.composable/config.yml`) and CLI overrides (`--build`, `--watch`, `--env-file`, `--restart`) for deep customizability. * Broadened the application ecosystem by adding fully featured `django`, `celery`, `celery-beat`, and `celery-flower` fragments, all utilizing robust `build` and `watch` options. * Created the `django-base` stack that pre-configures PostgreSQL, Valkey, Django, and Celery tasks seamlessly together. * Added automation in the `registry/build.ts` to copy and deploy JSON schemas directly to GitHub Pages for remote validation.
1 parent 5b17a1c commit 488ffd8

73 files changed

Lines changed: 3275 additions & 453 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/release-please-config.json

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,17 @@
88
"fragments",
99
"registry",
1010
"src/registry",
11-
"docs"
11+
"docs",
12+
"stacks"
1213
]
14+
},
15+
"fragments": {
16+
"release-type": "simple",
17+
"component": "fragments"
18+
},
19+
"stacks": {
20+
"release-type": "simple",
21+
"component": "stacks"
1322
}
1423
}
1524
}
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
name: Auto Merge Release PRs
2+
3+
on:
4+
pull_request:
5+
types:
6+
- opened
7+
- synchronize
8+
- reopened
9+
- labeled
10+
11+
permissions:
12+
contents: write
13+
pull-requests: write
14+
15+
jobs:
16+
auto-merge:
17+
runs-on: ubuntu-latest
18+
if: github.actor == 'release-please[bot]' || github.actor == 'github-actions[bot]'
19+
steps:
20+
- name: Auto-merge release-please PRs for fragments and stacks
21+
env:
22+
PR_URL: ${{github.event.pull_request.html_url}}
23+
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}
24+
run: |
25+
# Only auto-merge if it contains 'autorelease: pending' label
26+
# Note: We rely on GitHub branch protections/status checks passing before the merge actually occurs
27+
gh pr review --approve "$PR_URL"
28+
gh pr merge --auto --merge "$PR_URL"

.github/workflows/deploy.yml

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,20 @@ jobs:
4949
- name: Build Registry
5050
run: npm run build:registry
5151

52+
- name: Setup Python
53+
uses: actions/setup-python@v5
54+
with:
55+
python-version: 3.x
56+
57+
- name: Install MkDocs
58+
run: pip install mkdocs-material
59+
60+
- name: Build Docs
61+
run: mkdocs build -d site
62+
63+
- name: Merge Docs to Registry
64+
run: cp -r site/* registry/
65+
5266
- name: Sync back to gh-pages
5367
uses: peaceiris/actions-gh-pages@v3
5468
with:
Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
name: Scheduled Fragment Updates
2+
3+
on:
4+
schedule:
5+
- cron: '0 0 * * 0' # Run weekly on Sunday
6+
workflow_dispatch:
7+
8+
permissions:
9+
contents: write
10+
pull-requests: write
11+
issues: write
12+
13+
jobs:
14+
update-fragments:
15+
runs-on: ubuntu-latest
16+
steps:
17+
- name: Checkout
18+
uses: actions/checkout@v6
19+
20+
- name: Setup Node
21+
uses: actions/setup-node@v6
22+
with:
23+
node-version: 24
24+
25+
- name: Install dependencies
26+
run: npm install
27+
28+
- name: Update Docker Tags
29+
run: node scripts/update-tags.js
30+
31+
- name: Check for changes
32+
id: check_changes
33+
run: |
34+
if [[ -n $(git status --porcelain) ]]; then
35+
echo "changed=true" >> $GITHUB_OUTPUT
36+
else
37+
echo "changed=false" >> $GITHUB_OUTPUT
38+
fi
39+
40+
- name: Create Copilot Update Issue
41+
if: steps.check_changes.outputs.changed == 'true'
42+
uses: actions/github-script@v7
43+
with:
44+
script: |
45+
const issue = await github.rest.issues.create({
46+
owner: context.repo.owner,
47+
repo: context.repo.repo,
48+
title: "Update fragment image versions and docs",
49+
body: "The scheduled job has detected updated Docker image tags. Please assign Copilot to review these changes, update environment variables in `.yml` and `.json` files as needed, and ensure the corresponding `docs/fragments/` and `docs/stacks/` markdown files are updated with the latest frontmatter.\n\n@copilot review these changes and submit a pull request.",
50+
labels: ["automated-update"]
51+
});
52+
console.log(`Created issue ${issue.data.number}`);

.release-please-manifest.json

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
11
{
2-
".": "0.4.0"
2+
".": "0.4.0",
3+
"fragments": "0.1.0",
4+
"stacks": "0.1.0"
35
}

docs/commands.md

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,21 @@ Adds a fragment to the current project.
66

77
- **Type**: The category of the fragment (e.g., `compose`).
88
- **Name**: The name of the fragment (e.g., `postgresql`).
9+
- **Options**:
10+
- `-e, --extend`: Add the service directly to an existing `compose.yml` using extends syntax.
11+
- `-n, --name <customName>`: Override the name of the service.
12+
- `--no-build`: Do not inject `build` configurations from the fragment into the `compose.yml`.
13+
- `--no-watch`: Do not inject `develop.watch` configurations from the fragment into the `compose.yml`.
14+
15+
## `stack init <name>`
16+
17+
Initializes a stack by adding all of its configured fragments.
18+
19+
- **Name**: The name of the stack (e.g., `django-base`).
20+
- **Options**:
21+
- `-e, --extend`: Extend an existing compose file (enabled by default).
22+
- `--no-build`: Do not inject `build` configurations from the stack's fragments.
23+
- `--no-watch`: Do not inject `develop.watch` configurations from the stack's fragments.
924

1025
## `search [query]`
1126

docs/fragments/compose/arcadedb.md

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
---
2+
title: arcadedb
3+
description: Multi-model database engine (Graph, Document, Key/Value, Search)
4+
tags:
5+
- compose
6+
- fragment
7+
last_updated: 2026-04-18
8+
---
9+
10+
# arcadedb
11+
12+
Multi-model database engine (Graph, Document, Key/Value, Search)
13+
14+
## Variables
15+
16+
The following environment variables can be configured:
17+
18+
| Variable | Default Value | Description |
19+
|----------|---------------|-------------|
20+
| `ARCADEDB_VERSION` | `latest` | |
21+
| `ARCADEDB_STUDIO_PORT` | `2480` | |
22+
| `ARCADEDB_BINARY_PORT` | `2424` | |
23+
| `ARCADEDB_ROOT_PASSWORD` | `playwithdata` | |

docs/fragments/compose/caddy.md

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
---
2+
title: caddy
3+
description: Caddy web server with automatic HTTPS
4+
tags:
5+
- compose
6+
- fragment
7+
last_updated: 2026-04-18
8+
---
9+
10+
# caddy
11+
12+
Caddy web server with automatic HTTPS
13+
14+
## Variables
15+
16+
The following environment variables can be configured:
17+
18+
| Variable | Default Value | Description |
19+
|----------|---------------|-------------|
20+
| `CADDY_VERSION` | `latest` | |
21+
| `CADDY_HTTP_PORT` | `80` | |
22+
| `CADDY_HTTPS_PORT` | `443` | |
23+
| `CADDY_HTTPS_UDP_PORT` | `443` | |

docs/fragments/compose/chromadb.md

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
---
2+
title: chromadb
3+
description: Open-source AI application database (vector database)
4+
tags:
5+
- compose
6+
- fragment
7+
last_updated: 2026-04-18
8+
---
9+
10+
# chromadb
11+
12+
Open-source AI application database (vector database)
13+
14+
## Variables
15+
16+
The following environment variables can be configured:
17+
18+
| Variable | Default Value | Description |
19+
|----------|---------------|-------------|
20+
| `CHROMA_VERSION` | `latest` | |
21+
| `CHROMA_PORT` | `8000` | |
22+
| `CHROMA_PERSIST_DIRECTORY` | `/chroma/chroma` | |
23+
| `CHROMA_TELEMETRY` | `FALSE` | |
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
---
2+
title: eclipse-mosquitto
3+
description: Eclipse Mosquitto MQTT broker
4+
tags:
5+
- compose
6+
- fragment
7+
last_updated: 2026-04-18
8+
---
9+
10+
# eclipse-mosquitto
11+
12+
Eclipse Mosquitto MQTT broker
13+
14+
## Variables
15+
16+
The following environment variables can be configured:
17+
18+
| Variable | Default Value | Description |
19+
|----------|---------------|-------------|
20+
| `MOSQUITTO_VERSION` | `latest` | |
21+
| `MOSQUITTO_MQTT_PORT` | `1883` | |
22+
| `MOSQUITTO_WS_PORT` | `9001` | |

0 commit comments

Comments
 (0)