From a7ed46160ad68937a3c1385d28d736352e1fe883 Mon Sep 17 00:00:00 2001 From: Cameron Sparr Date: Wed, 9 Sep 2015 12:19:07 -0600 Subject: [PATCH] Re-arrange repo files for root dir cleanup --- CONTRIBUTING.md | 6 ++++-- Makefile | 7 ++++--- circle.yml | 2 +- Vagrantfile => scripts/Vagrantfile | 2 +- circle-test.sh => scripts/circle-test.sh | 0 docker-compose.yml => scripts/docker-compose.yml | 0 package.sh => scripts/package.sh | 2 +- 7 files changed, 11 insertions(+), 8 deletions(-) rename Vagrantfile => scripts/Vagrantfile (94%) rename circle-test.sh => scripts/circle-test.sh (100%) rename docker-compose.yml => scripts/docker-compose.yml (100%) rename package.sh => scripts/package.sh (99%) 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