Skip to content

Commit 85c6d94

Browse files
committed
adds a makefile to help testing on macbooks
1 parent d3bf19a commit 85c6d94

File tree

1 file changed

+18
-0
lines changed

1 file changed

+18
-0
lines changed

Makefile

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
# Extract the Go version directly from go.mod (e.g., "1.23")
2+
GO_VERSION = $(shell awk '/^toolchain / {sub(/go/,"",$$2) ; print $$2}' go.mod)
3+
4+
DOCKER_IMAGE = cni-outbound-test
5+
6+
.PHONY: test
7+
test:
8+
# Build the Docker image, passing GO_VERSION to the Docker build
9+
docker build \
10+
--build-arg GO_VERSION=$(GO_VERSION) \
11+
-f Dockerfile.test \
12+
-t $(DOCKER_IMAGE) .
13+
# Run the container, which by default executes "go test -v ./..."
14+
docker run --rm $(DOCKER_IMAGE)
15+
16+
.PHONY: clean
17+
clean:
18+
docker rmi $(DOCKER_IMAGE) || true

0 commit comments

Comments
 (0)