update to go 1.15 (#8220)
This commit is contained in:
parent
d840448b65
commit
b1b776f1e5
|
|
@ -4,12 +4,12 @@ defaults:
|
||||||
working_directory: '/go/src/github.com/influxdata/telegraf'
|
working_directory: '/go/src/github.com/influxdata/telegraf'
|
||||||
environment:
|
environment:
|
||||||
GOFLAGS: -p=8
|
GOFLAGS: -p=8
|
||||||
go-1_13: &go-1_13
|
|
||||||
docker:
|
|
||||||
- image: 'quay.io/influxdb/telegraf-ci:1.13.13'
|
|
||||||
go-1_14: &go-1_14
|
go-1_14: &go-1_14
|
||||||
docker:
|
docker:
|
||||||
- image: 'quay.io/influxdb/telegraf-ci:1.14.5'
|
- image: 'quay.io/influxdb/telegraf-ci:1.14.9'
|
||||||
|
go-1_15: &go-1_15
|
||||||
|
docker:
|
||||||
|
- image: 'quay.io/influxdb/telegraf-ci:1.15.2'
|
||||||
mac: &mac
|
mac: &mac
|
||||||
macos:
|
macos:
|
||||||
xcode: 11.3.1
|
xcode: 11.3.1
|
||||||
|
|
@ -21,7 +21,7 @@ defaults:
|
||||||
version: 2
|
version: 2
|
||||||
jobs:
|
jobs:
|
||||||
deps:
|
deps:
|
||||||
<<: [ *defaults, *go-1_14 ]
|
<<: [ *defaults, *go-1_15 ]
|
||||||
steps:
|
steps:
|
||||||
- checkout
|
- checkout
|
||||||
- restore_cache:
|
- restore_cache:
|
||||||
|
|
@ -62,22 +62,22 @@ jobs:
|
||||||
- 'usr/local/bin/gofmt'
|
- 'usr/local/bin/gofmt'
|
||||||
- 'Users/distiller/go'
|
- 'Users/distiller/go'
|
||||||
|
|
||||||
test-go-1.13:
|
test-go-1.14:
|
||||||
<<: [ *defaults, *go-1_13 ]
|
<<: [ *defaults, *go-1_14 ]
|
||||||
steps:
|
steps:
|
||||||
- attach_workspace:
|
- attach_workspace:
|
||||||
at: '/go'
|
at: '/go'
|
||||||
- run: 'make'
|
- run: 'make'
|
||||||
- run: 'make test'
|
- run: 'make test'
|
||||||
test-go-1.13-386:
|
test-go-1.14-386:
|
||||||
<<: [ *defaults, *go-1_13 ]
|
<<: [ *defaults, *go-1_14 ]
|
||||||
steps:
|
steps:
|
||||||
- attach_workspace:
|
- attach_workspace:
|
||||||
at: '/go'
|
at: '/go'
|
||||||
- run: 'GOARCH=386 make'
|
- run: 'GOARCH=386 make'
|
||||||
- run: 'GOARCH=386 make test'
|
- run: 'GOARCH=386 make test'
|
||||||
test-go-1.14:
|
test-go-1.15:
|
||||||
<<: [ *defaults, *go-1_14 ]
|
<<: [ *defaults, *go-1_15 ]
|
||||||
steps:
|
steps:
|
||||||
- attach_workspace:
|
- attach_workspace:
|
||||||
at: '/go'
|
at: '/go'
|
||||||
|
|
@ -85,8 +85,8 @@ jobs:
|
||||||
- run: 'make check'
|
- run: 'make check'
|
||||||
- run: 'make check-deps'
|
- run: 'make check-deps'
|
||||||
- run: 'make test'
|
- run: 'make test'
|
||||||
test-go-1.14-386:
|
test-go-1.15-386:
|
||||||
<<: [ *defaults, *go-1_14 ]
|
<<: [ *defaults, *go-1_15 ]
|
||||||
steps:
|
steps:
|
||||||
- attach_workspace:
|
- attach_workspace:
|
||||||
at: '/go'
|
at: '/go'
|
||||||
|
|
@ -103,7 +103,7 @@ jobs:
|
||||||
- run: 'make test'
|
- run: 'make test'
|
||||||
|
|
||||||
package:
|
package:
|
||||||
<<: [ *defaults, *go-1_14 ]
|
<<: [ *defaults, *go-1_15 ]
|
||||||
steps:
|
steps:
|
||||||
- attach_workspace:
|
- attach_workspace:
|
||||||
at: '/go'
|
at: '/go'
|
||||||
|
|
@ -113,7 +113,7 @@ jobs:
|
||||||
destination: 'build/dist'
|
destination: 'build/dist'
|
||||||
|
|
||||||
release:
|
release:
|
||||||
<<: [ *defaults, *go-1_14 ]
|
<<: [ *defaults, *go-1_15 ]
|
||||||
steps:
|
steps:
|
||||||
- attach_workspace:
|
- attach_workspace:
|
||||||
at: '/go'
|
at: '/go'
|
||||||
|
|
@ -122,7 +122,7 @@ jobs:
|
||||||
path: './build/dist'
|
path: './build/dist'
|
||||||
destination: 'build/dist'
|
destination: 'build/dist'
|
||||||
nightly:
|
nightly:
|
||||||
<<: [ *defaults, *go-1_14 ]
|
<<: [ *defaults, *go-1_15 ]
|
||||||
steps:
|
steps:
|
||||||
- attach_workspace:
|
- attach_workspace:
|
||||||
at: '/go'
|
at: '/go'
|
||||||
|
|
@ -144,18 +144,6 @@ workflows:
|
||||||
filters:
|
filters:
|
||||||
tags:
|
tags:
|
||||||
only: /.*/
|
only: /.*/
|
||||||
- 'test-go-1.13':
|
|
||||||
requires:
|
|
||||||
- 'deps'
|
|
||||||
filters:
|
|
||||||
tags:
|
|
||||||
only: /.*/
|
|
||||||
- 'test-go-1.13-386':
|
|
||||||
requires:
|
|
||||||
- 'deps'
|
|
||||||
filters:
|
|
||||||
tags:
|
|
||||||
only: /.*/
|
|
||||||
- 'test-go-1.14':
|
- 'test-go-1.14':
|
||||||
requires:
|
requires:
|
||||||
- 'deps'
|
- 'deps'
|
||||||
|
|
@ -168,6 +156,18 @@ workflows:
|
||||||
filters:
|
filters:
|
||||||
tags:
|
tags:
|
||||||
only: /.*/
|
only: /.*/
|
||||||
|
- 'test-go-1.15':
|
||||||
|
requires:
|
||||||
|
- 'deps'
|
||||||
|
filters:
|
||||||
|
tags:
|
||||||
|
only: /.*/
|
||||||
|
- 'test-go-1.15-386':
|
||||||
|
requires:
|
||||||
|
- 'deps'
|
||||||
|
filters:
|
||||||
|
tags:
|
||||||
|
only: /.*/
|
||||||
- 'test-go-darwin':
|
- 'test-go-darwin':
|
||||||
requires:
|
requires:
|
||||||
- 'macdeps'
|
- 'macdeps'
|
||||||
|
|
@ -177,17 +177,17 @@ workflows:
|
||||||
- 'package':
|
- 'package':
|
||||||
requires:
|
requires:
|
||||||
- 'test-go-darwin'
|
- 'test-go-darwin'
|
||||||
- 'test-go-1.13'
|
|
||||||
- 'test-go-1.13-386'
|
|
||||||
- 'test-go-1.14'
|
- 'test-go-1.14'
|
||||||
- 'test-go-1.14-386'
|
- 'test-go-1.14-386'
|
||||||
|
- 'test-go-1.15'
|
||||||
|
- 'test-go-1.15-386'
|
||||||
- 'release':
|
- 'release':
|
||||||
requires:
|
requires:
|
||||||
- 'test-go-darwin'
|
- 'test-go-darwin'
|
||||||
- 'test-go-1.13'
|
|
||||||
- 'test-go-1.13-386'
|
|
||||||
- 'test-go-1.14'
|
- 'test-go-1.14'
|
||||||
- 'test-go-1.14-386'
|
- 'test-go-1.14-386'
|
||||||
|
- 'test-go-1.15'
|
||||||
|
- 'test-go-1.15-386'
|
||||||
filters:
|
filters:
|
||||||
tags:
|
tags:
|
||||||
only: /.*/
|
only: /.*/
|
||||||
|
|
@ -197,28 +197,28 @@ workflows:
|
||||||
jobs:
|
jobs:
|
||||||
- 'deps'
|
- 'deps'
|
||||||
- 'macdeps'
|
- 'macdeps'
|
||||||
- 'test-go-1.13':
|
|
||||||
requires:
|
|
||||||
- 'deps'
|
|
||||||
- 'test-go-1.13-386':
|
|
||||||
requires:
|
|
||||||
- 'deps'
|
|
||||||
- 'test-go-1.14':
|
- 'test-go-1.14':
|
||||||
requires:
|
requires:
|
||||||
- 'deps'
|
- 'deps'
|
||||||
- 'test-go-1.14-386':
|
- 'test-go-1.14-386':
|
||||||
requires:
|
requires:
|
||||||
- 'deps'
|
- 'deps'
|
||||||
|
- 'test-go-1.15':
|
||||||
|
requires:
|
||||||
|
- 'deps'
|
||||||
|
- 'test-go-1.15-386':
|
||||||
|
requires:
|
||||||
|
- 'deps'
|
||||||
- 'test-go-darwin':
|
- 'test-go-darwin':
|
||||||
requires:
|
requires:
|
||||||
- 'macdeps'
|
- 'macdeps'
|
||||||
- 'nightly':
|
- 'nightly':
|
||||||
requires:
|
requires:
|
||||||
- 'test-go-darwin'
|
- 'test-go-darwin'
|
||||||
- 'test-go-1.13'
|
|
||||||
- 'test-go-1.13-386'
|
|
||||||
- 'test-go-1.14'
|
- 'test-go-1.14'
|
||||||
- 'test-go-1.14-386'
|
- 'test-go-1.14-386'
|
||||||
|
- 'test-go-1.15'
|
||||||
|
- 'test-go-1.15-386'
|
||||||
triggers:
|
triggers:
|
||||||
- schedule:
|
- schedule:
|
||||||
cron: "0 7 * * *"
|
cron: "0 7 * * *"
|
||||||
|
|
|
||||||
18
Makefile
18
Makefile
|
|
@ -91,7 +91,7 @@ telegraf:
|
||||||
# Used by dockerfile builds
|
# Used by dockerfile builds
|
||||||
.PHONY: go-install
|
.PHONY: go-install
|
||||||
go-install:
|
go-install:
|
||||||
go install -ldflags "-w -s $(LDFLAGS)" ./cmd/telegraf
|
go install -mod=mod -ldflags "-w -s $(LDFLAGS)" ./cmd/telegraf
|
||||||
|
|
||||||
.PHONY: test
|
.PHONY: test
|
||||||
test:
|
test:
|
||||||
|
|
@ -159,7 +159,7 @@ clean:
|
||||||
|
|
||||||
.PHONY: docker-image
|
.PHONY: docker-image
|
||||||
docker-image:
|
docker-image:
|
||||||
docker build -f scripts/stretch.docker -t "telegraf:$(commit)" .
|
docker build -f scripts/buster.docker -t "telegraf:$(commit)" .
|
||||||
|
|
||||||
plugins/parsers/influx/machine.go: plugins/parsers/influx/machine.go.rl
|
plugins/parsers/influx/machine.go: plugins/parsers/influx/machine.go.rl
|
||||||
ragel -Z -G2 $^ -o $@
|
ragel -Z -G2 $^ -o $@
|
||||||
|
|
@ -169,15 +169,15 @@ plugin-%:
|
||||||
@echo "Starting dev environment for $${$(@)} input plugin..."
|
@echo "Starting dev environment for $${$(@)} input plugin..."
|
||||||
@docker-compose -f plugins/inputs/$${$(@)}/dev/docker-compose.yml up
|
@docker-compose -f plugins/inputs/$${$(@)}/dev/docker-compose.yml up
|
||||||
|
|
||||||
|
.PHONY: ci-1.15
|
||||||
|
ci-1.15:
|
||||||
|
docker build -t quay.io/influxdb/telegraf-ci:1.15.2 - < scripts/ci-1.15.docker
|
||||||
|
docker push quay.io/influxdb/telegraf-ci:1.15.2
|
||||||
|
|
||||||
.PHONY: ci-1.14
|
.PHONY: ci-1.14
|
||||||
ci-1.14:
|
ci-1.14:
|
||||||
docker build -t quay.io/influxdb/telegraf-ci:1.14.5 - < scripts/ci-1.14.docker
|
docker build -t quay.io/influxdb/telegraf-ci:1.14.9 - < scripts/ci-1.14.docker
|
||||||
docker push quay.io/influxdb/telegraf-ci:1.14.5
|
docker push quay.io/influxdb/telegraf-ci:1.14.9
|
||||||
|
|
||||||
.PHONY: ci-1.13
|
|
||||||
ci-1.13:
|
|
||||||
docker build -t quay.io/influxdb/telegraf-ci:1.13.13 - < scripts/ci-1.13.docker
|
|
||||||
docker push quay.io/influxdb/telegraf-ci:1.13.13
|
|
||||||
|
|
||||||
.PHONY: install
|
.PHONY: install
|
||||||
install: $(buildbin)
|
install: $(buildbin)
|
||||||
|
|
|
||||||
|
|
@ -54,7 +54,7 @@ Ansible role: https://github.com/rossmcdonald/telegraf
|
||||||
|
|
||||||
Telegraf requires Go version 1.13 or newer, the Makefile requires GNU make.
|
Telegraf requires Go version 1.13 or newer, the Makefile requires GNU make.
|
||||||
|
|
||||||
1. [Install Go](https://golang.org/doc/install) >=1.13 (1.14 recommended)
|
1. [Install Go](https://golang.org/doc/install) >=1.13 (1.15 recommended)
|
||||||
2. Clone the Telegraf repository:
|
2. Clone the Telegraf repository:
|
||||||
```
|
```
|
||||||
cd ~/src
|
cd ~/src
|
||||||
|
|
|
||||||
2
go.mod
2
go.mod
|
|
@ -1,6 +1,6 @@
|
||||||
module github.com/influxdata/telegraf
|
module github.com/influxdata/telegraf
|
||||||
|
|
||||||
go 1.13
|
go 1.15
|
||||||
|
|
||||||
require (
|
require (
|
||||||
cloud.google.com/go v0.53.0
|
cloud.google.com/go v0.53.0
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
FROM golang:1.14.7 as builder
|
FROM golang:1.15.2 as builder
|
||||||
WORKDIR /go/src/github.com/influxdata/telegraf
|
WORKDIR /go/src/github.com/influxdata/telegraf
|
||||||
|
|
||||||
COPY . /go/src/github.com/influxdata/telegraf
|
COPY . /go/src/github.com/influxdata/telegraf
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,15 @@
|
||||||
|
FROM golang:1.15.2-buster as builder
|
||||||
|
WORKDIR /go/src/github.com/influxdata/telegraf
|
||||||
|
|
||||||
|
COPY . /go/src/github.com/influxdata/telegraf
|
||||||
|
RUN make go-install
|
||||||
|
|
||||||
|
FROM buildpack-deps:buster-curl
|
||||||
|
COPY --from=builder /go/bin/* /usr/bin/
|
||||||
|
COPY etc/telegraf.conf /etc/telegraf/telegraf.conf
|
||||||
|
|
||||||
|
EXPOSE 8125/udp 8092/udp 8094
|
||||||
|
|
||||||
|
COPY scripts/docker-entrypoint.sh /entrypoint.sh
|
||||||
|
ENTRYPOINT ["/entrypoint.sh"]
|
||||||
|
CMD ["telegraf"]
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
FROM golang:1.14.5
|
FROM golang:1.14.9
|
||||||
|
|
||||||
RUN chmod -R 755 "$GOPATH"
|
RUN chmod -R 755 "$GOPATH"
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
FROM golang:1.13.13
|
FROM golang:1.15.2
|
||||||
|
|
||||||
RUN chmod -R 755 "$GOPATH"
|
RUN chmod -R 755 "$GOPATH"
|
||||||
|
|
||||||
|
|
@ -21,8 +21,3 @@ RUN locale-gen C.UTF-8 || true
|
||||||
ENV LANG=C.UTF-8
|
ENV LANG=C.UTF-8
|
||||||
|
|
||||||
RUN gem install fpm
|
RUN gem install fpm
|
||||||
|
|
||||||
RUN go get -d github.com/golang/dep && \
|
|
||||||
cd src/github.com/golang/dep && \
|
|
||||||
git checkout -q v0.5.0 && \
|
|
||||||
go install -ldflags="-X main.version=v0.5.0" ./cmd/dep
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
FROM golang:1.14.7-stretch as builder
|
FROM golang:1.14.9-stretch as builder
|
||||||
WORKDIR /go/src/github.com/influxdata/telegraf
|
WORKDIR /go/src/github.com/influxdata/telegraf
|
||||||
|
|
||||||
COPY . /go/src/github.com/influxdata/telegraf
|
COPY . /go/src/github.com/influxdata/telegraf
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue