coreapp publish, and a Gitea Actions workflow in new apps
coreapp publish builds the release image, pushes image:version to the registry named in coreapp.toml and tags the commit v<version>. It refuses local-only image names (suggesting one from the git remote), uncommitted changes, a version already published and a tag already on another commit. The existence check uses docker buildx imagetools inspect: docker manifest inspect reported "no such manifest" for an image that existed. Any error but "not found" stops the publish. New apps get .gitea/workflows/publish.yml, which does the same on a v* tag, for repositories with a runner that can use Docker (secrets REGISTRY_USER and REGISTRY_TOKEN). Untested: needs a runner. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -182,8 +182,9 @@ The Core's own scripts trace secrets, so their output goes to
|
||||
|
||||
1. `cd $(mktemp -d) && coreapp new hello`: `./hello` has `coreapp.toml`,
|
||||
`Dockerfile`, `.dockerignore`, `icon.png`, `www/`, `README.md` and
|
||||
nothing else, with no `{{...}}` left (`grep -r '{{' hello` prints
|
||||
nothing). `coreapp new hello` again refuses; so does `coreapp new x-`.
|
||||
`.gitea/workflows/publish.yml`, and nothing else, with no placeholder
|
||||
left (`grep -r '{{[A-Z]' hello` prints nothing; the workflow's
|
||||
`${{ ... }}` are Gitea's). `coreapp new hello` again refuses; so does `coreapp new x-`.
|
||||
2. `cd hello && coreapp deploy`: updates `/opt/coreapps` on the Core,
|
||||
builds, copies the image, prints `Installing hello at 192.168.5.x`
|
||||
(the first free address there) and `Installed: https://hello.<domain>/`.
|
||||
@@ -290,3 +291,37 @@ again (they're read from its `DEPENDS`), Authelia not restarted; `.coreapp`
|
||||
then says which needs it has. Apps with an address outside 192.168.5.0/24
|
||||
get a new one on their next update (the container moves; the app keeps
|
||||
working), and apps with sign-in get their client copy.
|
||||
|
||||
## Publishing (coreapp publish)
|
||||
|
||||
With a throwaway registry on the workstation
|
||||
(`docker run -d --rm --name coreapp-test-registry -p 127.0.0.1:5000:5000 registry:2`;
|
||||
`docker stop coreapp-test-registry` afterwards removes it) and an app in a git
|
||||
repository with an `https://` origin:
|
||||
|
||||
1. With `image = "localhost/coreapp/..."`: refused, suggesting an image
|
||||
from the remote (`https://host/Owner/Repo.git` gives
|
||||
`host/owner/repo`).
|
||||
2. With `image = "localhost:5000/test/<name>"` and an uncommitted change:
|
||||
refused.
|
||||
3. Committed: builds, pushes, prints the digest, tags the commit
|
||||
`v<version>` (annotated) and prints the push commands. The registry
|
||||
lists the tag (`curl -s http://127.0.0.1:5000/v2/test/<name>/tags/list`);
|
||||
the image has the `org.opencontainers.image.*` labels (version,
|
||||
revision, title, source).
|
||||
4. Again: "already published", nothing pushed.
|
||||
5. A new commit without raising `version`: "The tag v<version> already
|
||||
exists on another commit".
|
||||
6. Raise `version`, commit, publish: the new tag is pushed alongside.
|
||||
7. Registry stopped: "Couldn't check ..." with the error, exit 1.
|
||||
|
||||
Against a real Gitea (needs the user's account): `docker login <gitea-host>`
|
||||
with a token that has `write:package`, `image = "<gitea-host>/<owner>/<repo>"`,
|
||||
`coreapp publish`: the package shows under the owner's Packages, linked to
|
||||
the repository. A private owner's packages need a login to pull.
|
||||
|
||||
The workflow (`.gitea/workflows/publish.yml`), on a repository with an
|
||||
Actions runner that can use Docker and the secrets `REGISTRY_USER` and
|
||||
`REGISTRY_TOKEN`: pushing tag `v<version>` publishes `image:version`; a tag
|
||||
that doesn't match `version`, a `localhost/` image, or a version already
|
||||
published fails the job with a message.
|
||||
|
||||
Reference in New Issue
Block a user