Scaffold the repository with a version command - #3
Merged
Merged
Conversation
A binary that does exactly one thing: print its version. The specsdeployd Ansible role installs it from a GitHub release, and the install task, the checksum verification and the ConditionPathExists assertion all need something real to point at. Layout mirrors specsnl/labelsync: a thin main.go that turns the command error into an exit code, a cobra tree under internal/cmd with one file per command, the Task + Docker Compose toolchain that pins Go, golangci-lint and Node, and a CI job that runs the same checks. The root's --version prints the bare value, for $(specsdeployd --version); the version subcommand names the binary. Both go through writeVersion, so the two renderings cannot drift. .goreleaser.yml and the Dockerfile inject internal/cmd.Version by its full path in a string no compiler checks — a rename would silently ship every release as "dev", so version_test.go asserts the path against both files. Out of scope, by the issue: the webhook receiver, the config schema, the podman/systemctl execution, and anything that reads /etc/specsdeployd. There is deliberately no runtime container image either — specsdeployd is a host systemd service, and this repo ships only the binary. Refs #1
Ilyes512
force-pushed
the
feat/scaffold-version-command
branch
from
September 13, 2026 18:15
561556b to
dbca486
Compare
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
specsdeployd version. Thinmain.go, cobra tree underinternal/cmd/,Versioninjected by ldflags.specsnl/labelsync: Task + Docker Compose pinning Go, golangci-lint and Node, plus.golangci.yml,.goreleaser.ymland a CI job running the same checks.mainis the bare minimum (README, LICENSE,.editorconfig,.gitignore); this branch carries the scaffold.Two deviations, on purpose
--versionprints the bare value,versionprints the sentence. The checklist says they mean the same; the Verify block asks forspecsdeployd version→specsdeployd version devand--version→dev. Implemented the Verify block — both go through onewriteVersion, so they cannot drift.exportstage yielding the binary. specsdeployd is a host systemd service, and this repo ships only the binary.Verified
Left unticked
specsnl/specsdeploydto thegogroup inspecsnl/specsops'slabels.yml— a change to another repository, so it needs its own PR there.Closes #1