chore: Using Windows, add exe extension to tools (#11608)

This commit is contained in:
Sebastian Spaink 2022-08-03 17:50:23 -05:00 committed by GitHub
parent f001c99184
commit fa811ed983
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 14 additions and 12 deletions

4
.gitignore vendored
View File

@ -4,8 +4,8 @@
/telegraf.exe /telegraf.exe
/telegraf.gz /telegraf.gz
/tools/package_lxd_test/package_lxd_test /tools/package_lxd_test/package_lxd_test
/tools/license_checker/license_checker /tools/license_checker/license_checker*
/tools/readme_config_includer/generator /tools/readme_config_includer/generator*
/vendor /vendor
.DS_Store .DS_Store
process.yml process.yml

View File

@ -1,11 +1,10 @@
ifeq ($(OS),Windows_NT) ifneq (,$(filter $(OS),Windows_NT Windows))
next_version := $(shell type build_version.txt) EXEEXT=.exe
tag := $(shell git describe --exact-match --tags 2> nul)
else
next_version := $(shell cat build_version.txt)
tag := $(shell git describe --exact-match --tags 2>/dev/null)
endif endif
next_version := $(shell cat build_version.txt)
tag := $(shell git describe --exact-match --tags 2>/dev/null)
branch := $(shell git rev-parse --abbrev-ref HEAD) branch := $(shell git rev-parse --abbrev-ref HEAD)
commit := $(shell git rev-parse --short=8 HEAD) commit := $(shell git rev-parse --short=8 HEAD)
glibc_version := 2.17 glibc_version := 2.17
@ -115,8 +114,8 @@ versioninfo:
go generate cmd/telegraf/telegraf_windows.go; \ go generate cmd/telegraf/telegraf_windows.go; \
build_tools: build_tools:
$(HOSTGO) build -o ./tools/license_checker/license_checker ./tools/license_checker $(HOSTGO) build -o ./tools/license_checker/license_checker$(EXEEXT) ./tools/license_checker
$(HOSTGO) build -o ./tools/readme_config_includer/generator ./tools/readme_config_includer/generator.go $(HOSTGO) build -o ./tools/readme_config_includer/generator$(EXEEXT) ./tools/readme_config_includer/generator.go
embed_readme_%: embed_readme_%:
go generate -run="readme_config_includer/generator$$" ./plugins/$*/... go generate -run="readme_config_includer/generator$$" ./plugins/$*/...

View File

@ -73,6 +73,9 @@ sudo yum install telegraf
Telegraf requires Go version 1.18 or newer, the Makefile requires GNU make. Telegraf requires Go version 1.18 or newer, the Makefile requires GNU make.
On Windows, the makefile requires the use of a bash terminal to support all makefile targets.
An easy option to get bash for windows is using the version that comes with [git for windows](https://gitforwindows.org/).
1. [Install Go](https://golang.org/doc/install) >=1.18 (1.18.0 recommended) 1. [Install Go](https://golang.org/doc/install) >=1.18 (1.18.0 recommended)
2. Clone the Telegraf repository: 2. Clone the Telegraf repository:
@ -80,11 +83,11 @@ Telegraf requires Go version 1.18 or newer, the Makefile requires GNU make.
git clone https://github.com/influxdata/telegraf.git git clone https://github.com/influxdata/telegraf.git
``` ```
3. Run `make` from the source directory 3. Run `make build` from the source directory
```shell ```shell
cd telegraf cd telegraf
make make build
``` ```
### Nightly Builds ### Nightly Builds