caddy-log-exporter/Taskfile.yml

133 lines
2.5 KiB
YAML
Raw Permalink 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-24 12:34:29 +02:00
ARCH_LIST: x86_64-linux
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-24 10:33:40 +02:00
- task: docker-build-all
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
2024-09-24 10:33:40 +02:00
- task: docker-publish-all
2024-09-20 09:21:49 +02:00
2024-09-23 11:31:05 +02:00
clean:
cmds:
2024-09-24 10:33:40 +02:00
- rm -rf result-*
2024-09-23 11:31:05 +02:00
docker-build:
2024-09-24 10:33:40 +02:00
requires:
vars:
- ARCH
2024-09-23 11:31:05 +02:00
status:
2024-09-24 10:33:40 +02:00
- test -f result-{{.ARCH}}
cmds:
- nix build .#docker --option system {{.ARCH}}
- mv result result-{{.ARCH}}
docker-build-all:
cmds:
- for:
2024-09-24 12:34:29 +02:00
var: ARCH_LIST
split: ","
2024-09-24 10:33:40 +02:00
task: docker-build
vars:
ARCH: "{{.ITEM}}"
docker-publish-all:
cmds:
2024-09-24 10:33:40 +02:00
- for:
2024-09-24 12:34:29 +02:00
var: ARCH_LIST
split: ","
2024-09-24 10:33:40 +02:00
task: docker-publish
vars:
ARCH: "{{.ITEM}}"
docker-local-import:
2024-09-24 12:34:29 +02:00
requires:
vars:
- ARCH
cmds:
2024-09-23 10:33:13 +02:00
- task: docker-build
2024-09-24 10:33:40 +02:00
vars:
ARCH: "{{.ARCH}}"
- |
{{.NIX_CMD_BASE}} \
skopeo \
--insecure-policy \
copy \
2024-09-24 10:33:40 +02:00
docker-archive:$(readlink -f result-{{.ARCH}}) \
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:
2024-09-24 10:33:40 +02:00
- ARCH
2024-09-20 09:21:49 +02:00
- GITHUB_USERNAME
- GITHUB_PASSWORD
- GIT_TAG
cmds:
2024-09-23 10:33:13 +02:00
- task: docker-build
2024-09-24 10:33:40 +02:00
vars:
ARCH: "{{.ARCH}}"
2024-09-20 09:21:49 +02:00
- |
{{.NIX_CMD_BASE}} \
skopeo \
--insecure-policy \
copy \
--dest-username {{.GITHUB_USERNAME}} --dest-password {{.GITHUB_PASSWORD}} \
2024-09-24 10:33:40 +02:00
docker-archive:$(readlink -f result-{{.ARCH}}) \
docker://ghcr.io/xsteadfastx/caddy-log-exporter-{{.ARCH}}:{{.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}} \
2024-09-23 12:48:11 +02:00
go test -v -race -count=1 ./internal/...
test-integration:
cmds:
2024-09-23 11:31:05 +02:00
- task: docker-local-import
2024-09-24 12:34:29 +02:00
vars:
ARCH: x86_64-linux
- |
{{.NIX_CMD_BASE}} \
2024-09-23 12:48:11 +02:00
go test -v -race -count=1 ./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