Skip to content

Commit 0376ea2

Browse files
Adds a makefile to ease builds/tests locally and adds a dockerignore file for faster docker builds (resmoio#154)
The makefile is for convenience purposes and the dockerignore file reduces the context to be passed to Docker daemon.
1 parent c1455c0 commit 0376ea2

File tree

2 files changed

+33
-0
lines changed

2 files changed

+33
-0
lines changed

Makefile

+28
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
.PHONY: build
2+
build: tidy ## Build the CLI
3+
go build
4+
5+
build-image: ## Build the Docker image
6+
docker build -t kubernetes-event-exporter .
7+
8+
.PHONY: fmt
9+
fmt: ## Run go fmt against code
10+
gofmt -s -l -w .
11+
12+
.PHONY: vet
13+
vet: ## Run go vet against code
14+
go vet ./...
15+
16+
tidy: ## Run go mod tidy
17+
go mod tidy
18+
19+
test: tidy ## Run tests
20+
go test -cover -mod=mod -v ./...
21+
22+
clean: ## Delete go.sum and clean mod cache
23+
go clean -modcache
24+
rm go.sum
25+
26+
.PHONY: help
27+
help: ## Display this help.
28+
@cat $(MAKEFILE_LIST) | sort | awk 'BEGIN {FS = ":.*##"; printf "\nUsage:\n make \033[36m<target>\033[0m\n"} /^[a-zA-Z_0-9-]+:.*?##/ { printf " \033[36m%-15s\033[0m %s\n", $$1, $$2 } /^##@/ { printf "\n\033[1m%s\033[0m\n", substr($$0, 5) } '

event-exporter.dockerignore

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
# Ignore everything
2+
*
3+
4+
# Include pkg directory
5+
!pkg/

0 commit comments

Comments
 (0)