diff --git a/cmd/agent/agent_test.go b/cmd/agent/agent_test.go index 32f64d43670..ded229ed635 100644 --- a/cmd/agent/agent_test.go +++ b/cmd/agent/agent_test.go @@ -16,9 +16,10 @@ package main import ( "fmt" - "github.com/stretchr/testify/assert" "os" "testing" + + "github.com/stretchr/testify/assert" ) func TestStringSliceAddToMap(t *testing.T) { @@ -126,6 +127,7 @@ func TestWriteAgentIDFileNotExists(t *testing.T) { } assert.EqualValues(t, "42\n", actual) } + func TestWriteAgentIDFileExists(t *testing.T) { parameters := []struct { fileInput string diff --git a/docker/Dockerfile.agent.alpine.multiarch b/docker/Dockerfile.agent.alpine.multiarch index 7bab5892171..d4fba3e66e0 100644 --- a/docker/Dockerfile.agent.alpine.multiarch +++ b/docker/Dockerfile.agent.alpine.multiarch @@ -6,7 +6,6 @@ ARG TARGETOS TARGETARCH RUN --mount=type=cache,target=/root/.cache/go-build \ --mount=type=cache,target=/go/pkg \ make build-agent -RUN mkdir -p /etc/woodpecker FROM alpine:3.18 RUN apk add -U --no-cache ca-certificates @@ -14,7 +13,7 @@ ENV GODEBUG=netdns=go EXPOSE 3000 COPY --from=build /src/dist/woodpecker-agent /bin/ -COPY --from=build /etc/woodpecker /etc +RUN mkdir -p /etc/woodpecker HEALTHCHECK CMD ["/bin/woodpecker-agent", "ping"] ENTRYPOINT ["/bin/woodpecker-agent"] diff --git a/docs/docs/30-administration/15-agent-config.md b/docs/docs/30-administration/15-agent-config.md index 53e0f31b2e2..ed65266632b 100644 --- a/docs/docs/30-administration/15-agent-config.md +++ b/docs/docs/30-administration/15-agent-config.md @@ -58,7 +58,7 @@ A shared secret used by server and agents to authenticate communication. A secre ### `WOODPECKER_AGENT_SECRET_FILE` > Default: empty -Read the value for `WOODPECKER_AGENT_SECRET` from the specified filepath +Read the value for `WOODPECKER_AGENT_SECRET` from the specified filepath, e.g. `/etc/woodpecker/agent-secret.conf` ### `WOODPECKER_LOG_LEVEL` > Default: empty