diff --git a/Taskfile.yml b/Taskfile.yml index 66b3baa..0a1d5db 100644 --- a/Taskfile.yml +++ b/Taskfile.yml @@ -6,7 +6,6 @@ tasks: cmds: - task: lint - task: test - - task: docker-build - task: docker-local-import - task: test-integration @@ -15,7 +14,6 @@ tasks: - task: lint - task: test - task: test-integration - - task: docker-build - task: docker-publish docker-build: @@ -24,6 +22,7 @@ tasks: docker-local-import: cmds: + - task: docker-build - | {{.NIX_CMD_BASE}} \ skopeo \ @@ -44,6 +43,7 @@ tasks: - GITHUB_PASSWORD - GIT_TAG cmds: + - task: docker-build - | {{.NIX_CMD_BASE}} \ skopeo \ diff --git a/internal/server/server.go b/internal/server/server.go index a5809f1..bebf8a2 100644 --- a/internal/server/server.go +++ b/internal/server/server.go @@ -28,6 +28,11 @@ func New(c config.Config) *Server { s.logFiles = c.LogFiles mux := http.NewServeMux() + + mux.HandleFunc("/healthz", func(w http.ResponseWriter, _ *http.Request) { + w.Write([]byte("ok")) //nolint:errcheck + }) + mux.HandleFunc("/metrics", s.metrics) s.httpServer = &http.Server{ diff --git a/test/integration/integration_test.go b/test/integration/integration_test.go index c4c8698..87a8e11 100644 --- a/test/integration/integration_test.go +++ b/test/integration/integration_test.go @@ -98,7 +98,8 @@ func TestIntegration(t *testing.T) { Mounts: vol, Image: "caddy-log-exporter:latest", ExposedPorts: []string{"2112:2112"}, - WaitingFor: wait.ForLog("serving http"), + WaitingFor: wait.ForHTTP("http://127.0.0.1:2112/healthz"). + WithStartupTimeout(5 * time.Minute), }, }, )