Skip to content

Commit

Permalink
add test & lint target
Browse files Browse the repository at this point in the history
  • Loading branch information
M00nF1sh committed Oct 31, 2018
1 parent 1d086d0 commit c80938a
Show file tree
Hide file tree
Showing 4 changed files with 117 additions and 4 deletions.
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
/aws-alb-ingress-controller
/server
/main
/profile.cov
/.vscode
*.tgz
/.idea
/profile.cov
/.bin
vendor/
11 changes: 9 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -21,18 +21,18 @@ TAG?=1.0-beta.7
PREFIX?=quay.io/coreos/alb-ingress-controller
ARCH?=amd64
OS?=linux
TEMP_DIR:=$(shell mktemp -d)
PKG=github.com/kubernetes-sigs/aws-alb-ingress-controller
REPO_INFO=$(shell git config --get remote.origin.url)
GO111MODULE=on
GOBIN:=$(shell pwd)/.bin

ifndef GIT_COMMIT
GIT_COMMIT := git-$(shell git rev-parse --short HEAD)
endif

LDFLAGS=-X $(PKG)/version.COMMIT=$(GIT_COMMIT) -X $(PKG)/version.RELEASE=$(TAG) -X $(PKG)/version.REPO=$(REPO_INFO)

server: cmd/main.go
server: cmd/main.go
CGO_ENABLED=0 GOOS=$(OS) GOARCH=$(ARCH) go build -a -installsuffix cgo -ldflags '-s -w $(LDFLAGS)' -o server ./cmd

container: server
Expand All @@ -44,3 +44,10 @@ push: push
clean:
rm -f server

lint:
GOBIN=$(GOBIN) go get -v github.com/golangci/golangci-lint/cmd/golangci-lint
$(GOBIN)/golangci-lint run --deadline=10m

unit-test:
go test ./...
test:unit-test
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ require (
github.com/gogo/protobuf v1.1.1 // indirect
github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b
github.com/golang/groupcache v0.0.0-20180513044358-24b0969c4cb7 // indirect
github.com/golangci/golangci-lint v1.11.2 // indirect
github.com/google/btree v0.0.0-20180124185431-e89373fe6b4a // indirect
github.com/google/gofuzz v0.0.0-20170612174753-24818f796faf // indirect
github.com/google/pprof v0.0.0-20181002142953-f36417847b1c // indirect
Expand All @@ -28,7 +29,6 @@ require (
github.com/mattbaird/jsonpatch v0.0.0-20171005235357-81af80346b1a // indirect
github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect
github.com/modern-go/reflect2 v0.0.0-20180701023420-4b7aa43c6742 // indirect
github.com/onsi/gomega v1.4.2 // indirect
github.com/pborman/uuid v1.2.0 // indirect
github.com/petar/GoLLRB v0.0.0-20130427215148-53be0d36a84c // indirect
github.com/peterbourgon/diskv v2.0.1+incompatible // indirect
Expand Down
Loading

0 comments on commit c80938a

Please sign in to comment.