diff --git a/circle.yml b/circle.yml new file mode 100644 index 000000000..c1cb16237 --- /dev/null +++ b/circle.yml @@ -0,0 +1,25 @@ +machine: + services: + - docker + environment: + GOPATH: /home/ubuntu + SRCDIR: /home/ubuntu/src/github.com/weaveworks/tools + PATH: $PATH:$HOME/bin + +dependencies: + post: + - go clean -i net + - go install -tags netgo std + - mkdir -p $(dirname $SRCDIR) + - cp -r $(pwd)/ $SRCDIR + - go get \ + github.com/golang/lint/golint \ + github.com/fzipp/gocyclo \ + github.com/kisielk/errcheck + +test: + override: + - cd $SRDDIR; ./lint . + - cd $SRCDIR/cover; make + - cd $SRCDIR/socks; make + diff --git a/cover/Makefile b/cover/Makefile new file mode 100644 index 000000000..1453e63e3 --- /dev/null +++ b/cover/Makefile @@ -0,0 +1,11 @@ +.PHONY: all clean + +all: cover + +cover: *.go + go get -tags netgo ./$(@D) + go build -ldflags "-extldflags \"-static\" -linkmode=external" -tags netgo -o $@ ./$(@D) + +clean: + rm -rf cover + go clean ./... diff --git a/lint b/lint index f3a2560f8..aac233b84 100755 --- a/lint +++ b/lint @@ -95,7 +95,7 @@ function lint { # Don't lint this script or static.go case "${filename}" in - ./bin/lint) return;; + ./lint) return;; ./app/static.go) return;; ./coverage.html) return;; esac diff --git a/socks/main.go b/socks/main.go index 45e69c6d1..171b5fc13 100644 --- a/socks/main.go +++ b/socks/main.go @@ -4,13 +4,13 @@ import ( "fmt" "net" "net/http" - "strings" "os" + "strings" "text/template" socks5 "github.com/armon/go-socks5" - "github.com/weaveworks/weave/common/mflagext" "github.com/docker/docker/pkg/mflag" + "github.com/weaveworks/weave/common/mflagext" ) const ( @@ -73,7 +73,7 @@ func (r aliasingResolver) Resolve(name string) (net.IP, error) { func socksProxy(aliases map[string]string) { conf := &socks5.Config{ Resolver: aliasingResolver{ - aliases: aliases, + aliases: aliases, NameResolver: socks5.DNSResolver{}, }, }