🐛 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
This commit is contained in:
2026-06-19 23:14:44 -04:00
parent 4b8f035091
commit dad20b0a43
2 changed files with 4 additions and 4 deletions
+3 -3
View File
@@ -39,7 +39,7 @@ PATH="/usr/local/etc/docker/bin:/usr/local/bin:/usr/bin:/usr/sbin:/bin:/sbin"
# - - - - - - - - - - - - - - - - - - - - - - - - -
# Set bash options
SCRIPT_FILE="$0"
CONTAINER_NAME="alpine"
CONTAINER_NAME="go"
SCRIPT_NAME="${SCRIPT_FILE##*/}"
CONTAINER_NAME="${ENV_CONTAINER_NAME:-$CONTAINER_NAME}"
# - - - - - - - - - - - - - - - - - - - - - - - - -
@@ -108,7 +108,7 @@ WEB_SERVER_PORT=""
# - - - - - - - - - - - - - - - - - - - - - - - - -
# Healthcheck variables
# enable healthcheck [yes/no]
HEALTH_ENABLED="yes"
HEALTH_ENABLED="${HEALTH_ENABLED:-yes}"
# comma separated list of processes for the healthcheck
SERVICES_LIST="tini"
# url endpoints: [http://localhost/health,http://localhost/test]
@@ -294,7 +294,7 @@ fi
if [ "$ENTRYPOINT_FIRST_RUN" != "no" ]; then
if [ "$CONFIG_DIR_INITIALIZED" = "no" ] || [ "$DATA_DIR_INITIALIZED" = "no" ]; then
if [ "$ENTRYPOINT_MESSAGE" = "yes" ]; then
echo "Executing entrypoint script for alpine"
echo "Executing entrypoint script for go"
fi
fi
# - - - - - - - - - - - - - - - - - - - - - - - - -
+1 -1
View File
@@ -43,7 +43,7 @@ retVal=$?
GO_EXITCODE=$((GO_EXITCODE + retVal))
# 3. Catch suspicious constructs
run_step "go vet ./..." go vet ./...
retval=$?
retVal=$?
GO_EXITCODE=$((GO_EXITCODE + retVal))
# 4. Run tests — fail fast before wasting time on a build
run_step "go test ./..." go test ./...