Skip to content

Commit 4b8a943

Browse files
authored
Merge pull request #102 from cloudfoundry-community/develop
Develop
2 parents 31cb615 + 492be58 commit 4b8a943

File tree

197 files changed

+15903
-3281
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

197 files changed

+15903
-3281
lines changed

.gitignore

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,18 @@
11
.idea
22

3-
scripts/*
4-
!scripts/*.template
3+
nozzle.sh
4+
5+
tools/*
6+
!tools/*.template
7+
!tools/*.go
58

69
cache.db
10+
*.out
711

812
main
913
splunk-firehose-nozzle
14+
env.sh
15+
data_gen
16+
1017
manifest*.yml
18+
splunk-firehose-nozzle.iml

Makefile

Lines changed: 91 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,91 @@
1+
UNAME := $(shell sh -c 'uname')
2+
COMMIT := $(shell sh -c 'git rev-parse HEAD')
3+
BRANCH := $(shell sh -c 'git rev-parse --abbrev-ref HEAD')
4+
5+
ifdef GOBIN
6+
PATH := $(GOBIN):$(PATH)
7+
else
8+
PATH := $(subst :,/bin:,$(GOPATH))/bin:$(PATH)
9+
endif
10+
11+
# Standard build
12+
default: installdeps build
13+
14+
installdeps:
15+
glide install --strip-vendor
16+
17+
updatedeps:
18+
glide update
19+
20+
initdeps:
21+
glide create
22+
23+
# -gcflags '-N -l' for debug
24+
# -ldflags -w for prod
25+
26+
linux:
27+
GOOS=linux GOARCH=amd64 make
28+
29+
mac:
30+
GOOS=darwin GOARCH=amd64 make
31+
32+
build-linux:
33+
GOOS=linux GOARCH=amd64 make build
34+
35+
build: build-nozzle build-app-dump build-data-gen
36+
37+
debug:
38+
DEBUG_FLAGS="-gcflags '-N -l'" make build
39+
40+
LDFLAGS="-X main.version=$(VERSION) -X main.commit=$(COMMIT) -X main.branch=$(BRANCH) -X main.buildos=$(UNAME)"
41+
42+
build-nozzle: fmt
43+
go build -o splunk-firehose-nozzle -ldflags ${LDFLAGS} ${DEBUG_FLAGS} ./main.go
44+
45+
build-app-dump:
46+
go build -o tools/dump_app_info/dump_app_info ./tools/dump_app_info/dump_app_info.go
47+
48+
build-data-gen:
49+
go build -o ci/data_gen/data_gen tools/data_gen/data_gen.go
50+
51+
PKGS=$(shell go list ./... | grep -v vendor | grep -v tools | grep -v testing | grep -v "splunk-firehose-nozzle$$")
52+
53+
deploy: deploy-nozzle deploy-data-gen
54+
55+
deploy-nozzle:
56+
@cf push -f ci/nozzle_manifest.yml -u process --random-route
57+
58+
deploy-data-gen:
59+
@cf push -f ci/data_gen_manifest.yml -u process -p tools/data_gen --random-route
60+
61+
integration-test: deploy-nozzle deploy-data-generation-app test
62+
63+
testall: test vet race cov
64+
65+
test:
66+
@go test ${PKGS}
67+
68+
# Run "short" unit tests
69+
test-short:
70+
@go test -short ${PKGS}
71+
72+
vet:
73+
@go vet ${PKGS}
74+
75+
race:
76+
@go test -race ${PKGS}
77+
78+
cov:
79+
@rm -f coverage-all.out
80+
@echo "mode: cover" > coverage-all.out
81+
$(foreach pkg,$(PKGS),\
82+
go test -coverprofile=coverage.out -cover -covermode=count $(pkg);\
83+
tail -n +2 coverage.out >> coverage-all.out;)
84+
@go tool cover -html=coverage-all.out
85+
86+
SRC_CODE=$(shell find . -type f -name "*.go" -not -path "./vendor/*")
87+
88+
fmt:
89+
@gofmt -l -w ${SRC_CODE}
90+
91+
all: installdeps testall build

0 commit comments

Comments
 (0)