Repository navigation
Publish a tested service image from CI and make the image start - #2
Merged
Merged
Conversation
The repository had CI but no delivery, and the image that the Dockerfile built
did not start: `mender serve` reads mender.yaml at startup and the image did not
contain it ("config file not found: mender.yaml", exit 1).
The Dockerfile now copies mender.yaml. The file holds no secrets, and a
different one can be mounted at /app/mender.yaml.
.github/workflows/image-smoke.sh starts an image on a port that Docker chooses
and waits for GET /healthz to answer with status ok. It fails on the image from
the old Dockerfile and passes on the new one. `make image` builds and runs it.
ci.yml has a new job, image, that runs after the checks job. It builds the
image and runs the smoke test on each pull request. On main and on version tags
it then pushes the same build to ghcr.io/yablokolabs/mender: main and
sha-<short> for main; X.Y.Z, X.Y and latest for a tag vX.Y.Z. It uses the
built-in token with packages write permission on that job only.
The existing steps move to actions/checkout v7 and setup-uv v10.2.0. setup-uv
publishes exact version tags only, so it is pinned to one.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
image, publishes the service image toghcr.io/yablokolabs/menderafter thechecksjob passes: tagsmainandsha-<short>for a push tomain;X.Y.Z,X.Yandlatestfor a tagvX.Y.Z.GET /healthzon each pull request, without a push.Dockerfiledid not start:mender servereadsmender.yamlat startup, and the image did not contain it (config file not found: mender.yaml, exit 1). TheDockerfilenow copies the file. It holds no secrets.actions/checkoutv4 to v7 andastral-sh/setup-uvv5 to v10.2.0. setup-uv publishes exact version tags only, so it is pinned to one.How it works
mainmain,sha-<short>vX.Y.ZX.Y.Z,X.Y,latestThe job uses the built-in
GITHUB_TOKEN. Write permission for packages is declared on theimagejob only; no new secret is necessary.Notes for the reviewer
mainis their first real test.linux/amd64only, because theDockerfiledownloads the amd64 kubectl binary.Test Plan
.github/workflows/image-smoke.shfails on the image from the oldDockerfile(container exits, the log shows the missing config file)make imagepasses on the new imagemake test: ruff, ruff format, mypy, pytest (84 tests)checks, thenimage(build and smoke test)mainpushes the image, anddocker pull ghcr.io/yablokolabs/mender:mainworks