diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 3e426594e..c08c50b5b 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -151,10 +151,12 @@ To execute Telegraf tests follow these simple steps: - Install docker compose following [these](https://docs.docker.com/compose/install/) instructions - - mac users should be able to simply do `brew install boot2docker` - and `brew install docker-compose` - execute `make test` +**OSX users**: you will need to install `boot2docker` or `docker-machine`. +The Makefile will assume that you have a `docker-machine` box called `default` to +get the IP address. + ### Unit test troubleshooting Try cleaning up your test environment by executing `make test-cleanup` and diff --git a/Makefile b/Makefile index 89db1d5b0..90443b2f9 100644 --- a/Makefile +++ b/Makefile @@ -22,10 +22,11 @@ prepare: docker-compose: ifeq ($(UNAME), Darwin) - ADVERTISED_HOST=$(shell sh -c 'boot2docker ip') docker-compose up -d + ADVERTISED_HOST=$(shell sh -c 'boot2docker ip || docker-machine ip default') \ + docker-compose --file scripts/docker-compose.yml up -d endif ifeq ($(UNAME), Linux) - ADVERTISED_HOST=localhost docker-compose up -d + ADVERTISED_HOST=localhost docker-compose --file scripts/docker-compose.yml up -d endif test: prepare docker-compose @@ -35,6 +36,6 @@ test-short: prepare $(GOPATH)/bin/godep go test -short ./... test-cleanup: - docker-compose kill + docker-compose --file scripts/docker-compose.yml kill .PHONY: test diff --git a/circle.yml b/circle.yml index 2c82bcfa7..0dcd6fc9f 100644 --- a/circle.yml +++ b/circle.yml @@ -4,5 +4,5 @@ dependencies: test: override: - - bash circle-test.sh + - bash scripts/circle-test.sh diff --git a/Vagrantfile b/scripts/Vagrantfile similarity index 94% rename from Vagrantfile rename to scripts/Vagrantfile index 72124a8ac..3c0199bdb 100644 --- a/Vagrantfile +++ b/scripts/Vagrantfile @@ -7,7 +7,7 @@ VAGRANTFILE_API_VERSION = "2" Vagrant.configure(VAGRANTFILE_API_VERSION) do |config| config.vm.box = "ubuntu/trusty64" - config.vm.synced_folder ".", "/home/vagrant/go/src/github.com/influxdb/telegraf", + config.vm.synced_folder "..", "/home/vagrant/go/src/github.com/influxdb/telegraf", type: "rsync", rsync__args: ["--verbose", "--archive", "--delete", "-z", "--safe-links"], rsync__exclude: ["./telegraf", ".vagrant/"] diff --git a/circle-test.sh b/scripts/circle-test.sh similarity index 100% rename from circle-test.sh rename to scripts/circle-test.sh diff --git a/docker-compose.yml b/scripts/docker-compose.yml similarity index 100% rename from docker-compose.yml rename to scripts/docker-compose.yml diff --git a/package.sh b/scripts/package.sh similarity index 99% rename from package.sh rename to scripts/package.sh index 406e7fce3..7f5196e33 100755 --- a/package.sh +++ b/scripts/package.sh @@ -204,7 +204,7 @@ if [ "$1" == "-h" ]; then fi VERSION=`git describe --always --tags | tr -d v` - +cd `git rev-parse --show-toplevel` echo -e "\nStarting package process, version: $VERSION\n" if [ "$CIRCLE_BRANCH" == "" ]; then