version: "3" vars: NIX_CMD_BASE: nix develop . -c tasks: ci: cmds: - task: lint - task: test - task: docker-local-import - task: test-integration ci-publish: cmds: - task: lint - task: test - task: test-integration - task: docker-publish docker-build: cmds: - nix build .#docker docker-local-import: cmds: - task: docker-build - | {{.NIX_CMD_BASE}} \ skopeo \ --insecure-policy \ copy \ docker-archive:$(readlink -f result) \ docker-daemon:caddy-log-exporter:latest - | {{.NIX_CMD_BASE}} \ skopeo \ inspect \ docker-daemon:caddy-log-exporter:latest docker-publish: requires: vars: - GITHUB_USERNAME - GITHUB_PASSWORD - GIT_TAG cmds: - task: docker-build - | {{.NIX_CMD_BASE}} \ skopeo \ --insecure-policy \ copy \ --dest-username {{.GITHUB_USERNAME}} --dest-password {{.GITHUB_PASSWORD}} \ docker-archive:$(readlink -f result) \ docker://ghcr.io/xsteadfastx/caddy-log-exporter:{{.GIT_TAG}} docker-inspect: cmds: - | {{.NIX_CMD_BASE}} \ skopeo \ inspect \ docker-archive:$(readlink -f result) lint: cmds: - | {{.NIX_CMD_BASE}} \ golangci-lint run --enable-all test: cmds: - | {{.NIX_CMD_BASE}} \ go test -v -race ./internal/... test-integration: cmds: - | {{.NIX_CMD_BASE}} \ go test -v -race ./test/integration/... tidy: cmds: - go mod tidy - go mod vendor