CI/CD in one evening, or what the pipeline setup taught me
I set up a pipeline for this site modeled after a bigger project's one. Sometimes a big project's example becomes the cause of ambiguous, hard-to-catch errors. But as they say, "the road is mastered by the walking", and here are my takeaways for small pet projects:
1. DooD is simpler than SSH
Deploying through a /var/run/docker.sock mounted into the runner removes
a whole class of key and access problems. The pipeline just drives the host's
docker directly.
2. Releases are directories + symlinks
Every release is a releases/<sha> directory, and a current symlink points at it.
Rollback = flip the symlink back. Keep the last three.
3. Absolute paths in bind mounts
The longest debugging of the evening: a bind mount through a symlink (current)
resolves unpredictably in Docker when the container is recreated.
The fix is passing the real absolute path via an environment variable in compose.
A smoke test after deploy is mandatory — twice it kept a broken release out of production.