Compare commits

..
2 Commits
3 changed files with 4 additions and 2 deletions

No files matched your search

+1 -1
View File
@@ -1,5 +1,5 @@
COMPOSE := {% if layout == 'part' %}cd .. && {% endif %}docker compose COMPOSE := {% if layout == 'part' %}cd .. && {% endif %}docker compose
IMAGE := {{ project_slug }}/{{ part }} IMAGE := {{ project_slug | replace('_', '-') }}/{{ part }}
changed = ! git diff --quiet $(1) -- $(2) 2>/dev/null changed = ! git diff --quiet $(1) -- $(2) 2>/dev/null
stamp = { git update-ref $(1) HEAD 2>/dev/null || true; } stamp = { git update-ref $(1) HEAD 2>/dev/null || true; }
@@ -1,7 +1,7 @@
services: services:
{{ service }}: {{ service }}:
build: {{ part_dir }} build: {{ part_dir }}
image: {{ project_slug }}/{{ part }} image: {{ project_slug | replace('_', '-') }}/{{ part }}
profiles: [{{ service }}, services] profiles: [{{ service }}, services]
restart: unless-stopped restart: unless-stopped
env_file: env_file:
@@ -10,3 +10,5 @@ make recreate
`make env` creates `.env` and `docker-compose.override.yml` from their examples. `make recreate` starts the selected profiles, `make rebuild` builds the image first, `make logs`, `make restart` and `make down` do what they say. `make env` creates `.env` and `docker-compose.override.yml` from their examples. `make recreate` starts the selected profiles, `make rebuild` builds the image first, `make logs`, `make restart` and `make down` do what they say.
To deploy, `git pull && make deploy`. It runs `make pre-deploy`, which rebuilds the image only when something in the repository changed, then `docker compose up -d`. A deploy system with its own `up` step calls `make pre-deploy` before it and `make post-deploy` after. What was built is remembered as `refs/deploy/*` in the clone. To deploy, `git pull && make deploy`. It runs `make pre-deploy`, which rebuilds the image only when something in the repository changed, then `docker compose up -d`. A deploy system with its own `up` step calls `make pre-deploy` before it and `make post-deploy` after. What was built 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 and write `.env` from sops. The repo only has to stay a plain recipe: images built from `build:` in compose, `caddy/site.caddy`. `make deploy` and `refs/deploy/*` are for a checkout deployed by hand.