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

View File

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