diff --git a/.circleci/config.yml b/.circleci/config.yml index dad9a5e0d1a38..2d3c152fedc8b 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -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,25 +144,25 @@ workflows: filters: tags: only: /.*/ - - 'test-go-1.13': + - 'test-go-1.14': requires: - 'deps' filters: tags: only: /.*/ - - 'test-go-1.13-386': + - 'test-go-1.14-386': requires: - 'deps' filters: tags: only: /.*/ - - 'test-go-1.14': + - 'test-go-1.15': requires: - 'deps' filters: tags: only: /.*/ - - 'test-go-1.14-386': + - 'test-go-1.15-386': requires: - 'deps' filters: @@ -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,16 +197,16 @@ workflows: jobs: - 'deps' - 'macdeps' - - 'test-go-1.13': + - 'test-go-1.14': requires: - 'deps' - - 'test-go-1.13-386': + - 'test-go-1.14-386': requires: - 'deps' - - 'test-go-1.14': + - 'test-go-1.15': requires: - 'deps' - - 'test-go-1.14-386': + - 'test-go-1.15-386': requires: - 'deps' - 'test-go-darwin': @@ -215,10 +215,10 @@ workflows: - '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 * * *" diff --git a/Makefile b/Makefile index 61b5b77315b93..4dd2754ec0910 100644 --- a/Makefile +++ b/Makefile @@ -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) diff --git a/README.md b/README.md index 9374645a77356..71239aa910ffb 100644 --- a/README.md +++ b/README.md @@ -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 diff --git a/go.mod b/go.mod index c3baca06af5f5..2cae7859a7d66 100644 --- a/go.mod +++ b/go.mod @@ -1,6 +1,6 @@ module github.com/influxdata/telegraf -go 1.13 +go 1.15 require ( cloud.google.com/go v0.53.0 diff --git a/scripts/alpine.docker b/scripts/alpine.docker index 395cbd8a33bc7..4c83e322d277e 100644 --- a/scripts/alpine.docker +++ b/scripts/alpine.docker @@ -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 diff --git a/scripts/buster.docker b/scripts/buster.docker new file mode 100644 index 0000000000000..3919d8ca5fd20 --- /dev/null +++ b/scripts/buster.docker @@ -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"] diff --git a/scripts/ci-1.14.docker b/scripts/ci-1.14.docker index 8f7a0fd449bd0..af3559460b3bd 100644 --- a/scripts/ci-1.14.docker +++ b/scripts/ci-1.14.docker @@ -1,4 +1,4 @@ -FROM golang:1.14.5 +FROM golang:1.14.9 RUN chmod -R 755 "$GOPATH" diff --git a/scripts/ci-1.13.docker b/scripts/ci-1.15.docker similarity index 66% rename from scripts/ci-1.13.docker rename to scripts/ci-1.15.docker index 6f175a1215429..65230db5f6f3b 100644 --- a/scripts/ci-1.13.docker +++ b/scripts/ci-1.15.docker @@ -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 diff --git a/scripts/stretch.docker b/scripts/stretch.docker index 642421513c65d..39c6e6c1a49d3 100644 --- a/scripts/stretch.docker +++ b/scripts/stretch.docker @@ -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