Compare commits
7
Commits
v0.3.0
...
940a599515
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
940a599515 | ||
|
|
e38ca1bf26 | ||
|
|
0538038deb | ||
|
|
65622715b5 | ||
|
|
6ee1f706e0 | ||
|
|
279fffb2ce | ||
|
|
8a18630e11 |
No files matched your search
@@ -11,6 +11,15 @@ A part is a directory with:
|
|||||||
|
|
||||||
Application services carry the `services` profile, databases and other infrastructure carry `external`.
|
Application services carry the `services` profile, databases and other infrastructure carry `external`.
|
||||||
|
|
||||||
|
`mcp_servers` writes `.mcp.json` with the Context7 and Svelte docs servers.
|
||||||
|
|
||||||
|
The root also gets a `renovate.jsonc` that is nothing but an `extends` on the
|
||||||
|
shared preset in `templates/renovate`. It does not subscribe the repo to
|
||||||
|
anything on its own: the bot walks an explicit list, so a new repo still has to
|
||||||
|
be added to `repositories` in `projects/personal/renovate/renovate-config.js`
|
||||||
|
of `infra/komodo`, and needs the `renovate`, `wait-3d` and `deps-code` labels
|
||||||
|
(`giteaproject <org>/<repo>` creates them).
|
||||||
|
|
||||||
```sh
|
```sh
|
||||||
copier copy --trust -d layout=parts -d 'parts=["backend","frontend"]' <this-repo> <dest>
|
copier copy --trust -d layout=parts -d 'parts=["backend","frontend"]' <this-repo> <dest>
|
||||||
copier update -a .copier/infra.yml
|
copier update -a .copier/infra.yml
|
||||||
|
|||||||
@@ -32,6 +32,15 @@ parts:
|
|||||||
frontend: frontend
|
frontend: frontend
|
||||||
default: []
|
default: []
|
||||||
|
|
||||||
|
mcp_servers:
|
||||||
|
type: str
|
||||||
|
multiselect: true
|
||||||
|
help: MCP servers in .mcp.json
|
||||||
|
choices:
|
||||||
|
Context7 (library docs): context7
|
||||||
|
Svelte docs: svelte
|
||||||
|
default: []
|
||||||
|
|
||||||
init_git:
|
init_git:
|
||||||
type: bool
|
type: bool
|
||||||
help: git init and install pre-commit hooks
|
help: git init and install pre-commit hooks
|
||||||
|
|||||||
@@ -13,4 +13,6 @@ sessions/*.session*
|
|||||||
node_modules/
|
node_modules/
|
||||||
.svelte-kit/
|
.svelte-kit/
|
||||||
/build/
|
/build/
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
# Local playground
|
||||||
|
/t/
|
||||||
@@ -0,0 +1,4 @@
|
|||||||
|
{
|
||||||
|
"$schema": "https://docs.renovatebot.com/renovate-schema.json",
|
||||||
|
"extends": ["local>templates/renovate"]
|
||||||
|
}
|
||||||
@@ -1,10 +1,19 @@
|
|||||||
PARTS := $(patsubst %/Makefile,%,$(wildcard */Makefile))
|
PARTS := $(patsubst %/Makefile,%,$(wildcard */Makefile))
|
||||||
|
|
||||||
.PHONY: env recreate rebuild restart logs down fmt check build
|
.PHONY: env recreate rebuild restart logs down deploy fmt check build pre-deploy post-deploy
|
||||||
|
|
||||||
env:
|
env:
|
||||||
@test -f .env || awk 'FNR == 1 && NR > 1 { print "" } 1' .env.example $(addsuffix /.env.example,$(PARTS)) > .env
|
@fresh=; test -f .env || { awk 'FNR == 1 && NR > 1 { print "" } 1' .env.example $(addsuffix /.env.example,$(PARTS)) > .env; fresh=1; }; \
|
||||||
@for part in $(PARTS); do test -f $$part/docker-compose.override.yml || cp $$part/docker-compose.override.yml.example $$part/docker-compose.override.yml; done
|
for part in $(PARTS); do \
|
||||||
|
override=$$part/docker-compose.override.yml; \
|
||||||
|
test -f $$override && continue; \
|
||||||
|
cp $$override.example $$override; \
|
||||||
|
for port in $$(sed -n 's/.*127\.0\.0\.1:\([0-9]*\):.*/\1/p' $$override | sort -u); do \
|
||||||
|
random=$$((20000 + $$(od -An -N2 -tu2 /dev/urandom) % 40000)); \
|
||||||
|
sed "s/127\.0\.0\.1:$$port:/127.0.0.1:$$random:/" $$override > $$override.tmp && mv $$override.tmp $$override; \
|
||||||
|
test -z "$$fresh" || { sed "s|localhost:$$port/|localhost:$$random/|" .env > .env.tmp && mv .env.tmp .env; }; \
|
||||||
|
done; \
|
||||||
|
done
|
||||||
|
|
||||||
recreate:
|
recreate:
|
||||||
docker compose up -d --force-recreate
|
docker compose up -d --force-recreate
|
||||||
@@ -21,5 +30,9 @@ logs:
|
|||||||
down:
|
down:
|
||||||
docker compose down
|
docker compose down
|
||||||
|
|
||||||
fmt check build:
|
deploy: pre-deploy
|
||||||
|
docker compose up -d
|
||||||
|
$(MAKE) post-deploy
|
||||||
|
|
||||||
|
fmt check build pre-deploy post-deploy:
|
||||||
@for part in $(PARTS); do $(MAKE) -C $$part $@ || exit 1; done
|
@for part in $(PARTS); do $(MAKE) -C $$part $@ || exit 1; done
|
||||||
@@ -11,4 +11,8 @@ make recreate
|
|||||||
|
|
||||||
`make env` creates `.env` from the examples of every part and copies each `docker-compose.override.yml.example`. `make recreate` starts the selected profiles, `make rebuild` builds the images first, `make logs`, `make restart` and `make down` do what they say.
|
`make env` creates `.env` from the examples of every part and copies each `docker-compose.override.yml.example`. `make recreate` starts the selected profiles, `make rebuild` builds the images first, `make logs`, `make restart` and `make down` do what they say.
|
||||||
|
|
||||||
|
To deploy, `git pull && make deploy`. It runs `make pre-deploy` in every part, which builds images only when their inputs changed and applies migrations, then `docker compose up -d`, then `make post-deploy`, which restarts the services whose mounted code changed. A deploy system with its own `up` step calls the two hooks around it. What was built and started is remembered as `refs/deploy/*` in the clone.
|
||||||
|
|
||||||
|
In the fleet, production is deployed from `infra/komodo` instead (git mode of Komodo, see `docs/architecture.md` there): Komodo clones this repo, and a layer plus `deploy.sh` in the stack's directory tag images by the hash of what they bake in, write `.env` from sops and run migrations before the code. The repo only has to stay a plain recipe: images built from `build:` in compose, migrations as the `migrator` service when there is a database, `caddy/site.caddy`. `make deploy` and `refs/deploy/*` are for a checkout deployed by hand.
|
||||||
|
|
||||||
`make fmt`, `make check` and `make build` run in every part. Part-specific targets live in the part's own Makefile: `make -C {{ parts[0] }} ...`.
|
`make fmt`, `make check` and `make build` run in every part. Part-specific targets live in the part's own Makefile: `make -C {{ parts[0] }} ...`.
|
||||||
@@ -0,0 +1,11 @@
|
|||||||
|
{%- set urls = {'context7': 'https://mcp.context7.com/mcp', 'svelte': 'https://mcp.svelte.dev/mcp'} -%}
|
||||||
|
{
|
||||||
|
"mcpServers": {
|
||||||
|
{%- for server in mcp_servers %}
|
||||||
|
"{{ server }}": {
|
||||||
|
"type": "http",
|
||||||
|
"url": "{{ urls[server] }}"
|
||||||
|
}{{ "," if not loop.last }}
|
||||||
|
{%- endfor %}
|
||||||
|
}
|
||||||
|
}
|
||||||
Reference in new issue
Block a user