showcase
- v0.2.4
- 37 commits
- 1 branch
- 6 tags
- updated
- CI 2/2
docs: release steps for tagging, images and deploy
Showing 2 changed files with 72 additions and 17 deletions.
README.md
+70 −7
@@ -52,14 +52,77 @@ under one path, for danieldaum.net/projects; clone, `go get` and52525353## Deploy545455See [deploy/README.md](deploy/README.md): releasing an image, running it at56code.danieldaum.net, moving Gitea to the tailnet, and serving it at57danieldaum.net/projects.55Running it at code.danieldaum.net, moving Gitea to the tailnet and serving56it at danieldaum.net/projects are in [deploy/README.md](deploy/README.md).57`just image` builds an image for this machine only, to try it locally.585859```sh60just image # build for this machine (needs Docker)61just release 0.1.0 # push git.danieldaum.net/daniel/showcase:0.1.062```59### Release a version6061A release is a signed git tag `v<version>` and an image62`git.danieldaum.net/daniel/showcase:<version>`, also tagged `latest`.63Versions follow semver: a fix bumps the patch (0.2.0 → 0.2.1), a feature64the minor (0.2.0 → 0.3.0). Run these on the Mac, which has Docker and the65signing key. The examples release 0.2.1.66671. **Check and push the commit.**6869 ```sh70 just lint && just test71 git status # clean: just release refuses uncommitted changes72 git log --oneline v0.2.0..HEAD # what goes into the release73 git push origin main74 ```75762. **Tag it.** Annotated and signed (`tag.gpgsign` is on; `-s` says so77 explicitly).7879 ```sh80 git tag -s v0.2.1 -m v0.2.181 git tag -v v0.2.1 # Good "git" signature82 git push origin v0.2.183 ```8485 Tagged the wrong commit? Before pushing, `git tag -d v0.2.1` and tag86 again. Once pushed, leave it and release 0.2.2.87883. **Build and push the image.**8990 ```sh91 docker login git.danieldaum.net # once; a Gitea token with write:package92 just release 0.2.1 # linux/amd64 + linux/arm64, tags 0.2.1 and latest93 ```9495 `just release` takes the version without the `v`, and refuses96 uncommitted changes or a HEAD that isn't tagged `v0.2.1`. The Docker97 tags are set at build time and buildx pushes straight to the registry,98 so there's no local image to `docker tag` or `docker push`. To point a99 tag at another version later, for example `latest` back to 0.2.0 after100 a bad release:101102 ```sh103 docker buildx imagetools create -t git.danieldaum.net/daniel/showcase:latest git.danieldaum.net/daniel/showcase:0.2.0104 ```1051064. **Write the release** (optional). In Gitea, Releases → New release,107 pick the existing tag `v0.2.1` and paste the `git log` from step 1 as108 notes. It shows on showcase's Releases tab, which only appears once a109 repo has a release. A tag without one is still listed under tags.1101115. **Deploy.** Pin the new digest in `deploy/compose.yaml` (the `image:`112 line and the version in the comment above it) and commit that:113114 ```sh115 crane digest git.danieldaum.net/daniel/showcase:0.2.1116 ```117118 Copy `compose.yaml` to the server and, next to it and `config.json`:119120 ```sh121 docker compose pull && docker compose up -d122 curl -s 127.0.0.1:8080/healthz # "ok" once a build is live123 ```124125### Container6312664127The container runs as uid 10001 with a read-only root filesystem, no65128capabilities and `no-new-privileges`. Only `/data` is writable: git mirrors
deploy/README.md
+2 −10
@@ -10,16 +10,8 @@ Three stages. Each one works on its own.10101111## Release an image121213On a machine with Docker (the Mac):1415```sh16git tag -s v0.1.0 -m v0.1.0 # signed, on a clean, committed tree17git push origin v0.1.018docker login git.danieldaum.net # a Gitea token with write:package19just release 0.1.0 # linux/amd64 + linux/arm64, tags 0.1.0 and latest20```2122The image is `git.danieldaum.net/daniel/showcase:0.1.0`.13Tagging, building, pushing and pinning a version are in the main14[README](../README.md#release-a-version).23152416## 1. code.danieldaum.net2517