From 7a23eb69eb6d262a100ccaa8136963f9aab025cf Mon Sep 17 00:00:00 2001 From: Cameron Sparr Date: Mon, 10 Aug 2015 10:22:15 -0600 Subject: [PATCH] Back to regular circle.yml, make and artifact linux binaries Remove the circle-test.sh script because that environment was having problems building all of gopsutil. --- circle-test.sh | 53 -------------------------------------------------- circle.yml | 29 ++++++++++++++++++--------- 2 files changed, 20 insertions(+), 62 deletions(-) delete mode 100755 circle-test.sh diff --git a/circle-test.sh b/circle-test.sh deleted file mode 100755 index 91916c6de..000000000 --- a/circle-test.sh +++ /dev/null @@ -1,53 +0,0 @@ -#!/bin/bash -# -# This is the InfluxDB CircleCI test script. Using this script allows total control -# the environment in which the build and test is run, and matches the official -# build process for InfluxDB. - -BUILD_DIR=$HOME/telegraf-build -GO_VERSION=go1.4.2 - -# Executes the given statement, and exits if the command returns a non-zero code. -function exit_if_fail { - command=$@ - echo "Executing '$command'" - $command - rc=$? - if [ $rc -ne 0 ]; then - echo "'$command' returned $rc." - exit $rc - fi -} - -source $HOME/.gvm/scripts/gvm -exit_if_fail gvm use $GO_VERSION - -# Set up the build directory, and then GOPATH. -exit_if_fail mkdir $BUILD_DIR -export GOPATH=$BUILD_DIR -exit_if_fail mkdir -p $GOPATH/src/github.com/influxdb - -# Dump some test config to the log. -echo "Test configuration" -echo "========================================" -echo "\$HOME: $HOME" -echo "\$GOPATH: $GOPATH" -echo "\$CIRCLE_BRANCH: $CIRCLE_BRANCH" - -# Move the checked-out source to a better location. -exit_if_fail mv $HOME/telegraf $GOPATH/src/github.com/influxdb -exit_if_fail cd $GOPATH/src/github.com/influxdb/telegraf -exit_if_fail git branch --set-upstream-to=origin/$CIRCLE_BRANCH $CIRCLE_BRANCH - -# Install the code. -exit_if_fail cd $GOPATH/src/github.com/influxdb/telegraf -exit_if_fail go get -t -d -v ./... -exit_if_fail git checkout $CIRCLE_BRANCH # 'go get' switches to master. Who knew? Switch back. -exit_if_fail go build -v ./... - -# Run the tests. -exit_if_fail [ `git ls-files | grep '.go$' | xargs gofmt -l 2>&1 | wc -l` -eq 0 ] -exit_if_fail go tool vet --composites=false . -exit_if_fail make test-short - -exit $rc diff --git a/circle.yml b/circle.yml index 0ccd9f5f8..10082b784 100644 --- a/circle.yml +++ b/circle.yml @@ -1,11 +1,22 @@ -machine: - pre: - - bash < <(curl -s -S -L https://raw.githubusercontent.com/moovweb/gvm/master/binscripts/gvm-installer) - - source $HOME/.gvm/scripts/gvm; gvm install go1.4.2 --binary - dependencies: - override: - - echo "Dummy override, so no Circle dependencies execute" + post: + # install golint + - go get github.com/golang/lint/golint + # install gox + - go get -u -f github.com/mitchellh/gox + # install binaries + - go install ./... + test: - override: - - bash circle-test.sh + pre: + # Go fmt should pass all files + - "[ `git ls-files | grep '.go$' | xargs gofmt -l 2>&1 | wc -l` -eq 0 ]" + - go vet ./... + - golint . + - golint testutil/... + - golint cmd/... + override: + - make test-short + post: + - gox -os="linux" -arch="386 amd64" ./... + - mv telegraf* $CIRCLE_ARTIFACTS