Commit Graph

3 Commits

Author SHA1 Message Date
jason dad20b0a43 🐛 Fix three entrypoint bugs 🐛
- CONTAINER_NAME was hardcoded to "alpine" instead of "go"; the startup
message said "alpine" for the same reason
- HEALTH_ENABLED was hard-assigned to "yes" after env files were sourced,
silently overriding the HEALTH_ENABLED="no" set in env/go.sh; changed
to ${HEALTH_ENABLED:-yes} so the env file value is respected
- go-workflow used retval (lowercase) to capture the go vet exit code but
then read retVal (uppercase) in the accumulator; the vet failure was
silently dropped and the gofmt exit code was summed twice instead
- rootfs/usr/local/bin/entrypoint.sh: fix CONTAINER_NAME default, startup
message label, and HEALTH_ENABLED hard-override
- rootfs/usr/local/bin/go-workflow: fix retval/retVal case mismatch so
go vet exit code is correctly propagated

rootfs/usr/local/bin/entrypoint.sh
rootfs/usr/local/bin/go-workflow
2026-06-19 23:14:44 -04:00
jason 4b8f035091 🔧 track exit codes and fix entrypoint invocation 🔧
- `go-workflow`: accumulate step exit codes into `GO_EXITCODE` and `exit $GO_EXITCODE` so failures propagate to the caller
- `run_step`: capture and return each step's exit code instead of silently swallowing it
- `entrypoint.sh`: replace `__exec_command go-workflow` with direct `go-workflow "$@"` so the process and args are passed correctly
- Strip trailing whitespace from `@@Other` and `@@Resource` header fields

rootfs/usr/local/bin/entrypoint.sh
rootfs/usr/local/bin/go-workflow
2026-06-12 14:10:04 -04:00
jason 4a5c802368 Default workflow: no-args runs tidy→fmt→vet→test→build
Replace the service-lifecycle init script with a lean Go-native
default workflow. Running the container with no arguments now
automatically formats, vets, tests, and builds the mounted project.
- rootfs/usr/local/etc/docker/init.d/00-go.sh: stripped from 979
lines of daemon-lifecycle boilerplate to 3 lines that export
CONTAINER_INIT=yes and SERVICE_USES_PID=no, telling the init
framework this is a configuration-only container (no daemon, no
keep-alive loop)
- rootfs/usr/local/bin/go-workflow: new script — runs the canonical
Go workflow in order: go mod tidy → gofmt -w . → go vet ./... →
go test ./... → go build ./...; exits 1 with a clear usage message
if no go.mod is found in /app
- rootfs/usr/local/bin/entrypoint.sh: no-args path in both the init
block and the * case now exec go-workflow instead of __no_exit;
verified: default workflow, explicit commands, sh -c passthrough,
and missing go.mod error all behave correctly
- README.md: document the default workflow prominently; update
one-shot examples; add golangci-lint --timeout note; add tail null
long-running pattern

README.md
rootfs/usr/local/bin/entrypoint.sh
rootfs/usr/local/bin/go-workflow
rootfs/usr/local/etc/docker/init.d/00-go.sh
2026-05-31 13:55:58 -04:00