- Change Makefile to output statically linked binary

- Change Vagrantfile
This commit is contained in:
me 2015-09-22 18:22:47 +08:00
parent 5e46d5e45a
commit 9a16e22c80
2 changed files with 7 additions and 3 deletions

View File

@ -2,7 +2,9 @@ UNAME := $(shell sh -c 'uname')
VERSION := $(shell sh -c 'git describe --always --tags') VERSION := $(shell sh -c 'git describe --always --tags')
build: prepare 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)" \ "-X main.Version $(VERSION)" \
./cmd/telegraf/telegraf.go ./cmd/telegraf/telegraf.go

6
Vagrantfile vendored
View File

@ -9,8 +9,10 @@ Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
config.vm.box = "ubuntu/trusty64" config.vm.box = "ubuntu/trusty64"
config.vm.synced_folder ".", "/home/vagrant/go/src/github.com/koksan83/telegraf", config.vm.synced_folder ".", "/home/vagrant/go/src/github.com/koksan83/telegraf",
type: "rsync", type: "rsync",
rsync__args: ["--verbose", "--archive", "--delete", "-z", "--safe-links"], rsync__args: ["--verbose"],
rsync__exclude: ["./telegraf", ".vagrant/"] # rsync__args: ["--verbose", "--archive", "--delete", "-z", "--safe-links"],
rsync__exclude: [".vagrant/"]
# rsync__exclude: ["./telegraf", ".vagrant/"]
config.vm.provision "shell", name: "sudo", inline: <<-SHELL config.vm.provision "shell", name: "sudo", inline: <<-SHELL
chown -R vagrant:vagrant /home/vagrant/go chown -R vagrant:vagrant /home/vagrant/go