inetmock/Taskfile.yml
Peter Kurfer 3c7810c32a
All checks were successful
concourse-ci/lint/protobuf Lint protobufs
concourse-ci/test/integration integration tests
concourse-ci/lint/golangci-lint Lint Go files
Add network monitoring through eBPF
- introduce netmon details to be emitted whenever a packet is observed not handled by InetMock
- rework cache configuration to re-use the same cache instance for all DNS handlers
- add an API to enable network monitoring per network interface including whitelists for IPs and ports
2022-12-21 21:15:05 +01:00

135 lines
3.4 KiB
YAML

version: "3"
vars:
OUT_DIR: ./out
INETMOCK_PKG: inetmock.icb4dc0.de/inetmock/cmd/inetmock
IMCTL_PKG: inetmock.icb4dc0.de/inetmock/cmd/imctl
DOCKER_ENDPOINT:
sh: echo "${DOCKER_ENDPOINT:-localhost}"
env:
GOOS: linux
GOARCH: amd64
CGO_ENABLED: 0
tasks:
default:
desc: By default run tests and build all binaries
cmds:
- task: test
- task: build
clean:
desc: clean all generated files
cmds:
- find . -type f \( -name "*.pb.go" -or -name "*.mock.go" -or -name "*_enum.go" \) -exec rm -f {} \;
- rm -rf ./main {{ .OUT_DIR }}
format:
desc: Format all changed source files
cmds:
- go run github.com/magefile/mage format
dep-graph:
desc: generate dependency graph
sources:
- go.mod
- go.sum
cmds:
- mkdir -p {{ .OUT_DIR }}
- gomod graph "**" | dot -Gdpi=0 -T svg -o {{ .OUT_DIR }}/dependency_graph.svg
lint:
desc: run all linters
cmds:
- go run github.com/magefile/mage testAll
generate:
desc: run all code generation steps
cmds:
- go run github.com/magefile/mage generate
test:
desc: run short running unit tests that do not need sudo
cmds:
- go run github.com/magefile/mage generate testShort
test-all:
desc: run all unit tests
cmds:
- go run github.com/magefile/mage generate testAll
integration-test:
desc: run all benchmarks/integration tests
cmds:
- go run github.com/magefile/mage generate integrationTests
debug-integration-test:
desc: run all benchmarks/integration tests
deps:
- generate
cmds:
- cat testdata/integration.imcs | dlv debug --headless --listen=:2345 --api-version=2 --accept-multiclient ./cmd/imctl -- check run --insecure --target {{ .DOCKER_ENDPOINT }} --log-level debug
cli-cover-report:
desc: generate a coverage report on the CLI
deps:
- test-all
cmds:
- go tool cover -func={{ .OUT_DIR }}/cov.out
html-cover-report:
desc: generate a coverage report as HTML page
deps:
- test-all
cmds:
- go tool cover -html={{ .OUT_DIR }}/cov.out -o {{ .OUT_DIR }}/coverage.html
build-inetmock:
desc: build the INetMock server part
cmds:
- task: build
vars:
TARGET_ID: inetmock
debug-inetmock:
desc: run INetMock server with delve for remote debugging
cmds:
- dlv --listen=:2345 --headless=true --api-version=2 --accept-multiclient --output {{ .OUT_DIR }}/__debug_bin debug {{ .INETMOCK_PKG }} -- serve
build-imctl:
desc: build the imctl INetMock client CLI
cmds:
- task: build
vars:
TARGET_ID: imctl
build:
desc: build all binaries
deps:
- generate
vars:
TARGET_ID: '{{ default "" .TARGET_ID }}'
cmds:
- goreleaser build --single-target --skip-validate --rm-dist {{ if .TARGET_ID }}--id {{ .TARGET_ID }}{{end}}
- mkdir -p {{ .OUT_DIR }}
- cp ./dist/*_linux_amd64/* {{ .OUT_DIR }}
snapshot-release:
desc: create a snapshot/test release without publishing any artifacts
deps:
- generate
cmds:
- goreleaser release --snapshot --skip-publish --rm-dist
release:
desc: create a release - includes artifact publishing
deps:
- generate
cmds:
- goreleaser release --rm-dist
docs:
desc: generate docs
cmds:
- mdbook build -d ./../public ./docs