Skip to content

Scaffold the repository with a version command - #3

Merged
Ilyes512 merged 1 commit into
mainfrom
feat/scaffold-version-command
Sep 13, 2026
Merged

Ilyes512 merged 1 commit into
mainfrom
feat/scaffold-version-command

Conversation

@Ilyes512

Copy link
Copy Markdown
Member

Summary

  • A binary that does exactly one thing: specsdeployd version. Thin main.go, cobra tree under internal/cmd/, Version injected by ldflags.
  • Toolchain mirroring specsnl/labelsync: Task + Docker Compose pinning Go, golangci-lint and Node, plus .golangci.yml, .goreleaser.yml and a CI job running the same checks.
  • Initial commit on main is the bare minimum (README, LICENSE, .editorconfig, .gitignore); this branch carries the scaffold.

Two deviations, on purpose

  • --version prints the bare value, version prints the sentence. The checklist says they mean the same; the Verify block asks for specsdeployd version → specsdeployd version dev and --version → dev. Implemented the Verify block — both go through one writeVersion, so they cannot drift.
  • No runtime container image. The Dockerfile stops at an export stage yielding the binary. specsdeployd is a host systemd service, and this repo ships only the binary.

Verified

task checkall        # tidy:check, lint (0 issues), test, md:check — green
task build           # version dev → "specsdeployd version <tag>", --version → "<tag>"
task release:dry-run # both linux archives + checksums.txt

Left unticked

  • Adding specsnl/specsdeployd to the go group in specsnl/specsops's labels.yml — a change to another repository, so it needs its own PR there.

Closes #1

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
Ilyes512 force-pushed the feat/scaffold-version-command branch from 561556b to dbca486 Compare September 13, 2026 18:15
@Ilyes512
Ilyes512 merged commit a061176 into main Sep 13, 2026
1 check passed
@Ilyes512
Ilyes512 deleted the feat/scaffold-version-command branch September 13, 2026 18:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Scaffold the repository with a version command

1 participant