Skip to content
This repository was archived by the owner on Jul 30, 2021. It is now read-only.

Commit 1f34600

Browse files
committed
Add travis tests
1 parent ef2c16b commit 1f34600

File tree

2 files changed

+18
-14
lines changed

2 files changed

+18
-14
lines changed

.travis.yml

+6
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
language: go
2+
go:
3+
- 1.6
4+
script:
5+
- test -z "$(go generate pkg/asset/templates_gen.go && git diff | tee /dev/stderr)"
6+
- make clean check all

Makefile

+12-14
Original file line numberDiff line numberDiff line change
@@ -5,26 +5,19 @@ export GOARCH:=amd64
55
GOFILES:=$(shell find . -name '*.go' | grep -v -E '(./vendor|internal/templates.go)')
66
GOPATH_BIN:=$(shell echo ${GOPATH} | awk 'BEGIN { FS = ":" }; { print $1 }')/bin
77

8-
all: fmt bin/linux/bootkube bin/darwin/bootkube vet
8+
all: bin/linux/bootkube bin/darwin/bootkube
99

10-
fmt:
10+
check: pkg/asset/internal/templates.go
1111
@find . -name vendor -prune -o -name '*.go' -exec gofmt -s -d {} +
12-
13-
vet: GOPACKAGES:=$(shell go list ./... | grep -v '/vendor/')
14-
vet:
15-
@go vet $(GOPACKAGES)
16-
17-
# This will naively try and create a vendor dir from a k8s release
18-
# USE: make vendor VENDOR_VERSION=vX.Y.Z
19-
VENDOR_VERSION = v1.2.1
20-
vendor: vendor-$(VENDOR_VERSION)
12+
@go vet $(shell go list ./... | grep -v '/vendor/')
13+
@go test -v $(shell go list ./... | grep -v '/vendor/')
2114

2215
bin/%/bootkube: $(GOFILES) pkg/asset/internal/templates.go
2316
mkdir -p $(dir $@)
2417
GOOS=$* go build -o bin/$*/bootkube github.com/coreos/bootkube/cmd/bootkube
2518

26-
install: all
27-
cp bin/$(shell uname | tr A-Z a-z)/bootkube $(GOPATH_BIN)
19+
install: bin/$(shell uname | tr A-Z a-z)/bootkube
20+
cp $< $(GOPATH_BIN)
2821

2922
pkg/asset/internal/templates.go: $(GOFILES)
3023
mkdir -p $(dir $@)
@@ -38,6 +31,11 @@ conformance-%: clean all
3831
@sleep 30 # Give addons a little time to start
3932
@cd hack/$*-node && ./conformance-test.sh
4033

34+
# This will naively try and create a vendor dir from a k8s release
35+
# USE: make vendor VENDOR_VERSION=vX.Y.Z
36+
VENDOR_VERSION = v1.2.1
37+
vendor: vendor-$(VENDOR_VERSION)
38+
4139
vendor-$(VENDOR_VERSION):
4240
@echo "Creating k8s vendor dir: $@"
4341
@mkdir -p $@/k8s.io/kubernetes
@@ -52,5 +50,5 @@ clean:
5250
rm -rf bin/
5351
rm -rf pkg/asset/internal
5452

55-
.PHONY: all clean fmt vet install pkg/asset/internal/templates.go
53+
.PHONY: all check clean install vendor pkg/asset/internal/templates.go
5654

0 commit comments

Comments
 (0)