From 9a16e22c808276a25afeb13b730da201ac90b683 Mon Sep 17 00:00:00 2001 From: me Date: Tue, 22 Sep 2015 18:22:47 +0800 Subject: [PATCH] - Change Makefile to output statically linked binary - Change Vagrantfile --- Makefile | 4 +++- Vagrantfile | 6 ++++-- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/Makefile b/Makefile index 5c27c5d95..926f3cefa 100644 --- a/Makefile +++ b/Makefile @@ -2,7 +2,9 @@ UNAME := $(shell sh -c 'uname') VERSION := $(shell sh -c 'git describe --always --tags') build: prepare - $(GOPATH)/bin/godep go build -o telegraf -ldflags \ + CGO_ENABLED=0 GOOS=linux ARCH=amd64 $(GOPATH)/bin/godep go build -a -installsuffix cgo \ + -o telegraf \ + -ldflags \ "-X main.Version $(VERSION)" \ ./cmd/telegraf/telegraf.go diff --git a/Vagrantfile b/Vagrantfile index a4140a0b5..ca5e8be26 100644 --- a/Vagrantfile +++ b/Vagrantfile @@ -9,8 +9,10 @@ Vagrant.configure(VAGRANTFILE_API_VERSION) do |config| config.vm.box = "ubuntu/trusty64" config.vm.synced_folder ".", "/home/vagrant/go/src/github.com/koksan83/telegraf", type: "rsync", - rsync__args: ["--verbose", "--archive", "--delete", "-z", "--safe-links"], - rsync__exclude: ["./telegraf", ".vagrant/"] + rsync__args: ["--verbose"], +# rsync__args: ["--verbose", "--archive", "--delete", "-z", "--safe-links"], + rsync__exclude: [".vagrant/"] + # rsync__exclude: ["./telegraf", ".vagrant/"] config.vm.provision "shell", name: "sudo", inline: <<-SHELL chown -R vagrant:vagrant /home/vagrant/go