forked from kubernetes/ingress-nginx
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Split implementations from generic code
- Loading branch information
Showing
107 changed files
with
5,777 additions
and
3,546 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,2 @@ | ||
nginx-ingress-controller | ||
rootfs/nginx-ingress-controller | ||
*/**/.coverprofile |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,25 +1,52 @@ | ||
all: push | ||
|
||
BUILDTAGS= | ||
|
||
# 0.0 shouldn't clobber any release builds | ||
TAG = 0.8.3 | ||
PREFIX = gcr.io/google_containers/nginx-ingress-controller | ||
RELEASE?=0.0 | ||
PREFIX?=gcr.io/google_containers/nginx-ingress-controller | ||
GOOS?=linux | ||
|
||
REPO_INFO=$(shell git config --get remote.origin.url) | ||
|
||
ifndef VERSION | ||
VERSION := git-$(shell git rev-parse --short HEAD) | ||
ifndef COMMIT | ||
COMMIT := git-$(shell git rev-parse --short HEAD) | ||
endif | ||
|
||
controller: controller.go clean | ||
CGO_ENABLED=0 GOOS=linux go build -a -installsuffix cgo -ldflags \ | ||
"-s -w -X main.version=${VERSION} -X main.gitRepo=${REPO_INFO}" \ | ||
-o nginx-ingress-controller | ||
PKG=k8s.io/ingress/controllers/nginx | ||
|
||
build: clean | ||
CGO_ENABLED=0 GOOS=${GOOS} go build -a -installsuffix cgo \ | ||
-ldflags "-s -w -X ${PKG}/pkg/version.RELEASE=${RELEASE} -X ${PKG}/pkg/version.COMMIT=${COMMIT} -X ${PKG}/pkg/version.REPO=${REPO_INFO}" \ | ||
-o rootfs/nginx-ingress-controller ${PKG}/pkg/cmd/controller | ||
|
||
container: | ||
docker build -t $(PREFIX):$(RELEASE) rootfs | ||
|
||
push: | ||
gcloud docker push $(PREFIX):$(RELEASE) | ||
|
||
fmt: | ||
@echo "+ $@" | ||
@go list -f '{{if len .TestGoFiles}}"gofmt -s -l {{.Dir}}"{{end}}' $(shell go list ${PKG}/... | grep -v vendor) | xargs -L 1 sh -c | ||
|
||
lint: | ||
@echo "+ $@" | ||
@go list -f '{{if len .TestGoFiles}}"golint {{.Dir}}/..."{{end}}' $(shell go list ${PKG}/... | grep -v vendor) | xargs -L 1 sh -c | ||
|
||
test: fmt lint vet | ||
@echo "+ $@" | ||
@go test -v -race -tags "$(BUILDTAGS) cgo" $(shell go list ${PKG}/... | grep -v vendor) | ||
|
||
container: controller | ||
docker build -t $(PREFIX):$(TAG) . | ||
cover: | ||
@echo "+ $@" | ||
@go list -f '{{if len .TestGoFiles}}"go test -coverprofile={{.Dir}}/.coverprofile {{.ImportPath}}"{{end}}' $(shell go list ${PKG}/... | grep -v vendor) | xargs -L 1 sh -c | ||
gover | ||
goveralls -coverprofile=gover.coverprofile -service travis-ci -repotoken ${COVERALLS_TOKEN} | ||
|
||
push: container | ||
gcloud docker push $(PREFIX):$(TAG) | ||
vet: | ||
@echo "+ $@" | ||
@go vet $(shell go list ${PKG}/... | grep -v vendor) | ||
|
||
clean: | ||
rm -f nginx-ingress-controller |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.