Skip to content

Commit

Permalink
Merge pull request kubernetes-retired#46 from aaronlevy/simple-checks
Browse files Browse the repository at this point in the history
Simple checks
  • Loading branch information
aaronlevy committed May 27, 2016
2 parents e0076be + 1f34600 commit f5744f7
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 18 deletions.
6 changes: 6 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
language: go
go:
- 1.6
script:
- test -z "$(go generate pkg/asset/templates_gen.go && git diff | tee /dev/stderr)"
- make clean check all
26 changes: 12 additions & 14 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -5,26 +5,19 @@ export GOARCH:=amd64
GOFILES:=$(shell find . -name '*.go' | grep -v -E '(./vendor|internal/templates.go)')
GOPATH_BIN:=$(shell echo ${GOPATH} | awk 'BEGIN { FS = ":" }; { print $1 }')/bin

all: fmt bin/linux/bootkube bin/darwin/bootkube vet
all: bin/linux/bootkube bin/darwin/bootkube

fmt:
check: pkg/asset/internal/templates.go
@find . -name vendor -prune -o -name '*.go' -exec gofmt -s -d {} +

vet: GOPACKAGES:=$(shell go list ./... | grep -v '/vendor/')
vet:
@go vet $(GOPACKAGES)

# This will naively try and create a vendor dir from a k8s release
# USE: make vendor VENDOR_VERSION=vX.Y.Z
VENDOR_VERSION = v1.2.1
vendor: vendor-$(VENDOR_VERSION)
@go vet $(shell go list ./... | grep -v '/vendor/')
@go test -v $(shell go list ./... | grep -v '/vendor/')

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

install: all
cp bin/$(shell uname | tr A-Z a-z)/bootkube $(GOPATH_BIN)
install: bin/$(shell uname | tr A-Z a-z)/bootkube
cp $< $(GOPATH_BIN)

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

# This will naively try and create a vendor dir from a k8s release
# USE: make vendor VENDOR_VERSION=vX.Y.Z
VENDOR_VERSION = v1.2.1
vendor: vendor-$(VENDOR_VERSION)

vendor-$(VENDOR_VERSION):
@echo "Creating k8s vendor dir: $@"
@mkdir -p $@/k8s.io/kubernetes
Expand All @@ -52,5 +50,5 @@ clean:
rm -rf bin/
rm -rf pkg/asset/internal

.PHONY: all clean fmt vet install pkg/asset/internal/templates.go
.PHONY: all check clean install vendor pkg/asset/internal/templates.go

2 changes: 0 additions & 2 deletions pkg/asset/internal/templates.go
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
package internal

// This file was generated by templates_gen.go. DO NOT EDIT by hand.
//
// Last generated at 2016-05-26 18:54:35.386963732 +0000 UTC.

var (
KubeConfigTemplate = _KubeConfigTemplate
Expand Down
2 changes: 0 additions & 2 deletions pkg/asset/templates_gen.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,6 @@ import (
var tmpl = template.Must(template.New("templates.go").Parse(`package internal
// This file was generated by templates_gen.go. DO NOT EDIT by hand.
//
// Last generated at {{ .Now }}.
var (
{{ range $i, $var := .Vars }} {{ $var.Name }} = _{{ $var.Name }}
Expand Down

0 comments on commit f5744f7

Please sign in to comment.