build: moving things around
Some checks failed
test / test (push) Waiting to run
release / release (push) Has been cancelled

This commit is contained in:
Marvin Preuss 2024-09-23 11:31:05 +02:00
parent 0232c98382
commit 62b1b8fb49
3 changed files with 21 additions and 11 deletions

View File

@ -1,3 +0,0 @@
FROM scratch
ENTRYPOINT ["/caddy-log-exporter"]
COPY caddy-log-exporter /

View File

@ -1,22 +1,29 @@
version: "3" version: "3"
vars: vars:
NIX_CMD_BASE: nix develop . -c NIX_CMD_BASE: nix develop . -c
tasks: tasks:
ci: ci:
cmds: cmds:
- task: clean
- task: lint - task: lint
- task: test - task: test-all
- task: docker-local-import
- task: test-integration
ci-publish: ci-publish:
cmds: cmds:
- task: clean
- task: lint - task: lint
- task: test - task: test-all
- task: test-integration
- task: docker-publish - task: docker-publish
clean:
cmds:
- rm -rf result
docker-build: docker-build:
status:
- test -f result
cmds: cmds:
- nix build .#docker - nix build .#docker
@ -29,12 +36,12 @@ tasks:
--insecure-policy \ --insecure-policy \
copy \ copy \
docker-archive:$(readlink -f result) \ docker-archive:$(readlink -f result) \
docker-daemon:caddy-log-exporter:latest docker-daemon:caddy-log-exporter:NOTUSE
- | - |
{{.NIX_CMD_BASE}} \ {{.NIX_CMD_BASE}} \
skopeo \ skopeo \
inspect \ inspect \
docker-daemon:caddy-log-exporter:latest docker-daemon:caddy-log-exporter:NOTUSE
docker-publish: docker-publish:
requires: requires:
@ -75,10 +82,16 @@ tasks:
test-integration: test-integration:
cmds: cmds:
- task: docker-local-import
- | - |
{{.NIX_CMD_BASE}} \ {{.NIX_CMD_BASE}} \
go test -v -race ./test/integration/... go test -v -race ./test/integration/...
test-all:
cmds:
- task: test
- task: test-integration
tidy: tidy:
cmds: cmds:
- go mod tidy - go mod tidy

View File

@ -99,7 +99,7 @@ func TestIntegration(t *testing.T) {
"CADDY_LOG_EXPORTER_LOG_FILES": "/var/log/caddy/caddy.log", "CADDY_LOG_EXPORTER_LOG_FILES": "/var/log/caddy/caddy.log",
}, },
Mounts: vol, Mounts: vol,
Image: "caddy-log-exporter:latest", Image: "caddy-log-exporter:NOTUSE",
ExposedPorts: []string{"2112:2112"}, ExposedPorts: []string{"2112:2112"},
WaitingFor: wait.ForHTTP("http://127.0.0.1:2112/healthz"). WaitingFor: wait.ForHTTP("http://127.0.0.1:2112/healthz").
WithStartupTimeout(5 * time.Minute), WithStartupTimeout(5 * time.Minute),