refactor: drop make deploy and its refs/deploy stamps, the fleet deploys from infra/komodo; short readme
This commit is contained in:
1 parent
ea78a12a83
commit
c573c1b1e8
3 files changed
+4
-29
No files matched your search
@@ -1,9 +1,6 @@
|
||||
COMPOSE := {% if layout == 'part' %}cd .. && {% endif %}docker compose
|
||||
IMAGE := {{ project_slug | replace('_', '-') }}/{{ part }}
|
||||
changed = ! git diff --quiet $(1) -- $(2) 2>/dev/null
|
||||
stamp = { git update-ref $(1) HEAD 2>/dev/null || true; }
|
||||
|
||||
.PHONY: {% if layout == 'root' %}env recreate rebuild restart logs down deploy {% endif %}fmt check build pre-deploy post-deploy
|
||||
.PHONY: {% if layout == 'root' %}env recreate rebuild restart logs down {% endif %}fmt check build
|
||||
|
||||
fmt:
|
||||
@:
|
||||
@@ -13,14 +10,6 @@ check:
|
||||
|
||||
build:
|
||||
$(COMPOSE) build {{ service }}
|
||||
|
||||
pre-deploy:
|
||||
@if $(call changed,refs/deploy/{{ part }},.) || ! docker image inspect $(IMAGE) >/dev/null 2>&1; then \
|
||||
$(MAKE) build && $(call stamp,refs/deploy/{{ part }}); \
|
||||
fi
|
||||
|
||||
post-deploy:
|
||||
@:
|
||||
{% if layout == 'root' %}
|
||||
env:
|
||||
@fresh=; test -f .env || { cp .env.example .env; fresh=1; }; \
|
||||
@@ -47,8 +36,4 @@ logs:
|
||||
|
||||
down:
|
||||
$(COMPOSE) down
|
||||
|
||||
deploy: pre-deploy
|
||||
$(COMPOSE) up -d
|
||||
$(MAKE) post-deploy
|
||||
{% endif %}
|
||||
@@ -1,14 +1,6 @@
|
||||
# {{ project_name }}
|
||||
|
||||
Runs in Docker, locally the same way as in production. `COMPOSE_PROFILES` in `.env` selects the services that run on this machine. `docker-compose.override.yml` holds what differs between machines: published ports and the aliases on the external `caddy` network.
|
||||
|
||||
```sh
|
||||
make env
|
||||
make recreate
|
||||
make env # .env and docker-compose.override.yml from the examples
|
||||
make recreate # the services in COMPOSE_PROFILES
|
||||
```
|
||||
|
||||
`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.
|
||||
|
||||
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.
|
||||
Reference in new issue
Block a user