From 1f87c10dd4b92e4a65081532fad1b54550fc45f5 Mon Sep 17 00:00:00 2001 From: Daniel Nelson Date: Fri, 2 Feb 2018 12:25:59 -0800 Subject: [PATCH] Fix Makefile on Windows and use in AppVeyor build (#3748) --- Makefile | 2 +- appveyor.yml | 13 +++++++------ 2 files changed, 8 insertions(+), 7 deletions(-) diff --git a/Makefile b/Makefile index f71e127a7..3250e69ed 100644 --- a/Makefile +++ b/Makefile @@ -2,7 +2,7 @@ PREFIX := /usr/local VERSION := $(shell git describe --exact-match --tags 2>/dev/null) BRANCH := $(shell git rev-parse --abbrev-ref HEAD) COMMIT := $(shell git rev-parse --short HEAD) -GOFILES ?= $(shell find . -name '*.go') +GOFILES ?= $(shell git ls-files '*.go') GOFMT ?= $(shell gofmt -l $(GOFILES)) ifdef GOBIN diff --git a/appveyor.yml b/appveyor.yml index 1a52f8adc..993870209 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -13,20 +13,21 @@ platform: x64 install: - IF NOT EXIST "C:\Cache" mkdir C:\Cache - IF NOT EXIST "C:\Cache\go1.9.2.msi" curl -o "C:\Cache\go1.9.2.msi" https://storage.googleapis.com/golang/go1.9.2.windows-amd64.msi + - IF NOT EXIST "C:\Cache\gnuwin32-bin.zip" curl -o "C:\Cache\gnuwin32-bin.zip" https://dl.influxdata.com/telegraf/ci/make-3.81-bin.zip + - IF NOT EXIST "C:\Cache\gnuwin32-dep.zip" curl -o "C:\Cache\gnuwin32-dep.zip" https://dl.influxdata.com/telegraf/ci/make-3.81-dep.zip - IF EXIST "C:\Go" rmdir /S /Q C:\Go - msiexec.exe /i "C:\Cache\go1.9.2.msi" /quiet + - 7z x "C:\Cache\gnuwin32-bin.zip" -oC:\GnuWin32 -y + - 7z x "C:\Cache\gnuwin32-dep.zip" -oC:\GnuWin32 -y - go version - go env build_script: - - cmd: go get github.com/sparrc/gdm - - cmd: C:\gopath\bin\gdm restore - - cmd: go build -i -o telegraf.exe ./cmd/telegraf/telegraf.go + - cmd: C:\GnuWin32\bin\make deps + - cmd: C:\GnuWin32\bin\make telegraf test_script: - - cmd: go test ./plugins/inputs/ping/... - - cmd: go test ./plugins/inputs/win_perf_counters/... - - cmd: go test ./plugins/inputs/win_services/... + - cmd: C:\GnuWin32\bin\make test-windows artifacts: - path: telegraf.exe