Add circle.yml, lint etc

This commit is contained in:
Tom Wilkie
2015-08-13 11:25:07 +00:00
parent 7325e4504b
commit fab7da7a1a
4 changed files with 40 additions and 4 deletions

25
circle.yml Normal file
View File

@@ -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

11
cover/Makefile Normal file
View File

@@ -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 ./...

2
lint
View File

@@ -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

View File

@@ -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{},
},
}