caddy-log-exporter/Taskfile.yml

99 lines
1.8 KiB
YAML
Raw Normal View History

2024-09-19 11:21:05 +02:00
version: "3"
2024-09-23 11:31:05 +02:00
2024-09-19 11:21:05 +02:00
vars:
NIX_CMD_BASE: nix develop . -c
2024-09-23 11:31:05 +02:00
2024-09-19 11:21:05 +02:00
tasks:
ci:
cmds:
2024-09-23 11:31:05 +02:00
- task: clean
2024-09-19 11:21:05 +02:00
- task: lint
2024-09-23 11:31:05 +02:00
- task: test-all
2024-09-20 09:21:49 +02:00
ci-publish:
cmds:
2024-09-23 11:31:05 +02:00
- task: clean
2024-09-20 09:21:49 +02:00
- task: lint
2024-09-23 11:31:05 +02:00
- task: test-all
- task: docker-publish
2024-09-20 09:21:49 +02:00
2024-09-23 11:31:05 +02:00
clean:
cmds:
- rm -rf result
docker-build:
2024-09-23 11:31:05 +02:00
status:
- test -f result
cmds:
- nix build .#docker
docker-local-import:
cmds:
2024-09-23 10:33:13 +02:00
- task: docker-build
- |
{{.NIX_CMD_BASE}} \
skopeo \
--insecure-policy \
copy \
docker-archive:$(readlink -f result) \
2024-09-23 11:31:05 +02:00
docker-daemon:caddy-log-exporter:NOTUSE
- |
{{.NIX_CMD_BASE}} \
skopeo \
inspect \
2024-09-23 11:31:05 +02:00
docker-daemon:caddy-log-exporter:NOTUSE
docker-publish:
2024-09-20 09:21:49 +02:00
requires:
vars:
- GITHUB_USERNAME
- GITHUB_PASSWORD
- GIT_TAG
cmds:
2024-09-23 10:33:13 +02:00
- task: docker-build
2024-09-20 09:21:49 +02:00
- |
{{.NIX_CMD_BASE}} \
skopeo \
--insecure-policy \
copy \
--dest-username {{.GITHUB_USERNAME}} --dest-password {{.GITHUB_PASSWORD}} \
docker-archive:$(readlink -f result) \
2024-09-20 09:21:49 +02:00
docker://ghcr.io/xsteadfastx/caddy-log-exporter:{{.GIT_TAG}}
2024-09-19 11:21:05 +02:00
docker-inspect:
cmds:
- |
{{.NIX_CMD_BASE}} \
skopeo \
inspect \
docker-archive:$(readlink -f result)
2024-09-19 11:21:05 +02:00
lint:
cmds:
2024-09-20 09:21:49 +02:00
- |
{{.NIX_CMD_BASE}} \
golangci-lint run --enable-all
2024-09-19 11:21:05 +02:00
test:
cmds:
2024-09-20 09:21:49 +02:00
- |
{{.NIX_CMD_BASE}} \
go test -v -race ./internal/...
test-integration:
cmds:
2024-09-23 11:31:05 +02:00
- task: docker-local-import
- |
{{.NIX_CMD_BASE}} \
go test -v -race ./test/integration/...
2024-09-19 12:01:49 +02:00
2024-09-23 11:31:05 +02:00
test-all:
cmds:
- task: test
- task: test-integration
2024-09-19 12:01:49 +02:00
tidy:
cmds:
- go mod tidy
- go mod vendor