update to go 1.15 (#8220)

This commit is contained in:
Steven Soroka 2020-10-07 14:51:49 -04:00 committed by GitHub
parent d840448b65
commit b1b776f1e5
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
9 changed files with 70 additions and 60 deletions

View File

@ -4,12 +4,12 @@ defaults:
working_directory: '/go/src/github.com/influxdata/telegraf'
environment:
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
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
macos:
xcode: 11.3.1
@ -21,7 +21,7 @@ defaults:
version: 2
jobs:
deps:
<<: [ *defaults, *go-1_14 ]
<<: [ *defaults, *go-1_15 ]
steps:
- checkout
- restore_cache:
@ -62,22 +62,22 @@ jobs:
- 'usr/local/bin/gofmt'
- 'Users/distiller/go'
test-go-1.13:
<<: [ *defaults, *go-1_13 ]
test-go-1.14:
<<: [ *defaults, *go-1_14 ]
steps:
- attach_workspace:
at: '/go'
- run: 'make'
- run: 'make test'
test-go-1.13-386:
<<: [ *defaults, *go-1_13 ]
test-go-1.14-386:
<<: [ *defaults, *go-1_14 ]
steps:
- attach_workspace:
at: '/go'
- run: 'GOARCH=386 make'
- run: 'GOARCH=386 make test'
test-go-1.14:
<<: [ *defaults, *go-1_14 ]
test-go-1.15:
<<: [ *defaults, *go-1_15 ]
steps:
- attach_workspace:
at: '/go'
@ -85,8 +85,8 @@ jobs:
- run: 'make check'
- run: 'make check-deps'
- run: 'make test'
test-go-1.14-386:
<<: [ *defaults, *go-1_14 ]
test-go-1.15-386:
<<: [ *defaults, *go-1_15 ]
steps:
- attach_workspace:
at: '/go'
@ -103,7 +103,7 @@ jobs:
- run: 'make test'
package:
<<: [ *defaults, *go-1_14 ]
<<: [ *defaults, *go-1_15 ]
steps:
- attach_workspace:
at: '/go'
@ -113,7 +113,7 @@ jobs:
destination: 'build/dist'
release:
<<: [ *defaults, *go-1_14 ]
<<: [ *defaults, *go-1_15 ]
steps:
- attach_workspace:
at: '/go'
@ -122,7 +122,7 @@ jobs:
path: './build/dist'
destination: 'build/dist'
nightly:
<<: [ *defaults, *go-1_14 ]
<<: [ *defaults, *go-1_15 ]
steps:
- attach_workspace:
at: '/go'
@ -144,18 +144,6 @@ workflows:
filters:
tags:
only: /.*/
- 'test-go-1.13':
requires:
- 'deps'
filters:
tags:
only: /.*/
- 'test-go-1.13-386':
requires:
- 'deps'
filters:
tags:
only: /.*/
- 'test-go-1.14':
requires:
- 'deps'
@ -168,6 +156,18 @@ workflows:
filters:
tags:
only: /.*/
- 'test-go-1.15':
requires:
- 'deps'
filters:
tags:
only: /.*/
- 'test-go-1.15-386':
requires:
- 'deps'
filters:
tags:
only: /.*/
- 'test-go-darwin':
requires:
- 'macdeps'
@ -177,17 +177,17 @@ workflows:
- 'package':
requires:
- 'test-go-darwin'
- 'test-go-1.13'
- 'test-go-1.13-386'
- 'test-go-1.14'
- 'test-go-1.14-386'
- 'test-go-1.15'
- 'test-go-1.15-386'
- 'release':
requires:
- 'test-go-darwin'
- 'test-go-1.13'
- 'test-go-1.13-386'
- 'test-go-1.14'
- 'test-go-1.14-386'
- 'test-go-1.15'
- 'test-go-1.15-386'
filters:
tags:
only: /.*/
@ -197,28 +197,28 @@ workflows:
jobs:
- 'deps'
- 'macdeps'
- 'test-go-1.13':
requires:
- 'deps'
- 'test-go-1.13-386':
requires:
- 'deps'
- 'test-go-1.14':
requires:
- 'deps'
- 'test-go-1.14-386':
requires:
- 'deps'
- 'test-go-1.15':
requires:
- 'deps'
- 'test-go-1.15-386':
requires:
- 'deps'
- 'test-go-darwin':
requires:
- 'macdeps'
- 'nightly':
requires:
- 'test-go-darwin'
- 'test-go-1.13'
- 'test-go-1.13-386'
- 'test-go-1.14'
- 'test-go-1.14-386'
- 'test-go-1.15'
- 'test-go-1.15-386'
triggers:
- schedule:
cron: "0 7 * * *"

View File

@ -91,7 +91,7 @@ telegraf:
# Used by dockerfile builds
.PHONY: go-install
go-install:
go install -ldflags "-w -s $(LDFLAGS)" ./cmd/telegraf
go install -mod=mod -ldflags "-w -s $(LDFLAGS)" ./cmd/telegraf
.PHONY: test
test:
@ -159,7 +159,7 @@ clean:
.PHONY: 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
ragel -Z -G2 $^ -o $@
@ -169,15 +169,15 @@ plugin-%:
@echo "Starting dev environment for $${$(@)} input plugin..."
@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
ci-1.14:
docker build -t quay.io/influxdb/telegraf-ci:1.14.5 - < scripts/ci-1.14.docker
docker push quay.io/influxdb/telegraf-ci:1.14.5
.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
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.9
.PHONY: install
install: $(buildbin)

View File

@ -54,7 +54,7 @@ Ansible role: https://github.com/rossmcdonald/telegraf
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:
```
cd ~/src

2
go.mod
View File

@ -1,6 +1,6 @@
module github.com/influxdata/telegraf
go 1.13
go 1.15
require (
cloud.google.com/go v0.53.0

View File

@ -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
COPY . /go/src/github.com/influxdata/telegraf

15
scripts/buster.docker Normal file
View File

@ -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"]

View File

@ -1,4 +1,4 @@
FROM golang:1.14.5
FROM golang:1.14.9
RUN chmod -R 755 "$GOPATH"

View File

@ -1,4 +1,4 @@
FROM golang:1.13.13
FROM golang:1.15.2
RUN chmod -R 755 "$GOPATH"
@ -21,8 +21,3 @@ RUN locale-gen C.UTF-8 || true
ENV LANG=C.UTF-8
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

View File

@ -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
COPY . /go/src/github.com/influxdata/telegraf