2015-08-06 18:26:02 +00:00
|
|
|
dependencies:
|
2015-08-10 16:22:15 +00:00
|
|
|
post:
|
2015-08-10 18:58:58 +00:00
|
|
|
# install rpm & fpm for packaging
|
|
|
|
- which rpmbuild || sudo apt-get install rpm
|
|
|
|
- gem install fpm
|
2015-08-10 16:22:15 +00:00
|
|
|
# install golint
|
|
|
|
- go get github.com/golang/lint/golint
|
|
|
|
# install gox
|
|
|
|
- go get -u -f github.com/mitchellh/gox
|
|
|
|
|
2015-08-04 14:58:32 +00:00
|
|
|
test:
|
2015-08-10 16:22:15 +00:00
|
|
|
pre:
|
2015-08-10 18:58:58 +00:00
|
|
|
# install binaries
|
|
|
|
- go install ./...
|
2015-08-10 16:22:15 +00:00
|
|
|
# Go fmt should pass all files
|
2015-08-12 21:22:55 +00:00
|
|
|
- "[ `git ls-files | grep '.go$' | xargs gofmt -l | tee /tmp/foo | wc -l` -eq 0 ] || (cat /tmp/foo; exit 1)"
|
2015-08-10 16:22:15 +00:00
|
|
|
- go vet ./...
|
2015-08-12 21:22:55 +00:00
|
|
|
- "[ `golint . | tee /tmp/foo | wc -l` == 0 ] || (cat /tmp/foo; exit 1)"
|
|
|
|
- "[ `golint testutil/... | tee /tmp/foo | wc -l` == 0 ] || (cat /tmp/foo; exit 1)"
|
|
|
|
- "[ `golint cmd/... | tee /tmp/foo | wc -l` == 0 ] || (cat /tmp/foo; exit 1)"
|
2015-08-10 16:22:15 +00:00
|
|
|
override:
|
|
|
|
- make test-short
|
|
|
|
post:
|
2015-08-10 18:58:58 +00:00
|
|
|
# Build linux binaries
|
2015-08-10 16:22:15 +00:00
|
|
|
- gox -os="linux" -arch="386 amd64" ./...
|
|
|
|
- mv telegraf* $CIRCLE_ARTIFACTS
|
2015-08-10 18:58:58 +00:00
|
|
|
# Build .deb and .rpm files
|
|
|
|
- "GOPATH=/home/ubuntu/.go_project ./package.sh `git rev-parse --short HEAD`"
|
|
|
|
- mv telegraf*{deb,rpm} $CIRCLE_ARTIFACTS
|