From 1ec12ba6ad972e60d0201920798921894c9784f7 Mon Sep 17 00:00:00 2001 From: Trevor Pounds Date: Fri, 19 Oct 2018 14:01:31 -0400 Subject: [PATCH] Add Go 1.11 CI support (#4859) --- .circleci/config.yml | 48 +++++++++++++++++++++++++++++++----------- Makefile | 5 +++++ scripts/ci-1.11.docker | 28 ++++++++++++++++++++++++ 3 files changed, 69 insertions(+), 12 deletions(-) create mode 100644 scripts/ci-1.11.docker diff --git a/.circleci/config.yml b/.circleci/config.yml index d9c085dff..ae8771583 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -8,11 +8,14 @@ defaults: go-1_10: &go-1_10 docker: - image: 'quay.io/influxdb/telegraf-ci:1.10.4' + go-1_11: &go-1_11 + docker: + - image: 'quay.io/influxdb/telegraf-ci:1.11.1' version: 2 jobs: deps: - <<: [ *defaults, *go-1_10 ] + <<: [ *defaults, *go-1_11 ] steps: - checkout - restore_cache: @@ -42,16 +45,25 @@ jobs: at: '/go/src' - run: 'make check' - run: 'make test' - test-go-1.10-386: - <<: [ *defaults, *go-1_10 ] + test-go-1.11: + <<: [ *defaults, *go-1_11 ] steps: - attach_workspace: at: '/go/src' - - run: 'GOARCH=386 make check' + # disabled due to gofmt differences (1.10 vs 1.11). + # - run: 'make check' + - run: 'make test' + test-go-1.11-386: + <<: [ *defaults, *go-1_11 ] + steps: + - attach_workspace: + at: '/go/src' + # disabled due to gofmt differences (1.10 vs 1.11). + # - run: 'GOARCH=386 make check' - run: 'GOARCH=386 make test' package: - <<: [ *defaults, *go-1_10 ] + <<: [ *defaults, *go-1_11 ] steps: - attach_workspace: at: '/go/src' @@ -60,7 +72,7 @@ jobs: path: './build' destination: 'build' release: - <<: [ *defaults, *go-1_10 ] + <<: [ *defaults, *go-1_11 ] steps: - attach_workspace: at: '/go/src' @@ -69,7 +81,7 @@ jobs: path: './build' destination: 'build' nightly: - <<: [ *defaults, *go-1_10 ] + <<: [ *defaults, *go-1_11 ] steps: - attach_workspace: at: '/go/src' @@ -98,7 +110,13 @@ workflows: filters: tags: only: /.*/ - - 'test-go-1.10-386': + - 'test-go-1.11': + requires: + - 'deps' + filters: + tags: + only: /.*/ + - 'test-go-1.11-386': requires: - 'deps' filters: @@ -108,12 +126,14 @@ workflows: requires: - 'test-go-1.9' - 'test-go-1.10' - - 'test-go-1.10-386' + - 'test-go-1.11' + - 'test-go-1.11-386' - 'release': requires: - 'test-go-1.9' - 'test-go-1.10' - - 'test-go-1.10-386' + - 'test-go-1.11' + - 'test-go-1.11-386' filters: tags: only: /.*/ @@ -128,14 +148,18 @@ workflows: - 'test-go-1.10': requires: - 'deps' - - 'test-go-1.10-386': + - 'test-go-1.11': + requires: + - 'deps' + - 'test-go-1.11-386': requires: - 'deps' - 'nightly': requires: - 'test-go-1.9' - 'test-go-1.10' - - 'test-go-1.10-386' + - 'test-go-1.11' + - 'test-go-1.11-386' triggers: - schedule: cron: "0 7 * * *" diff --git a/Makefile b/Makefile index d19d4d4cd..b55924e3f 100644 --- a/Makefile +++ b/Makefile @@ -131,6 +131,11 @@ plugin-%: @echo "Starting dev environment for $${$(@)} input plugin..." @docker-compose -f plugins/inputs/$${$(@)}/dev/docker-compose.yml up +.PHONY: ci-1.11 +ci-1.11: + docker build -t quay.io/influxdb/telegraf-ci:1.11.1 - < scripts/ci-1.11.docker + docker push quay.io/influxdb/telegraf-ci:1.11.1 + .PHONY: ci-1.10 ci-1.10: docker build -t quay.io/influxdb/telegraf-ci:1.10.4 - < scripts/ci-1.10.docker diff --git a/scripts/ci-1.11.docker b/scripts/ci-1.11.docker new file mode 100644 index 000000000..31ff34842 --- /dev/null +++ b/scripts/ci-1.11.docker @@ -0,0 +1,28 @@ +FROM golang:1.11.1 + +RUN chmod -R 755 "$GOPATH" + +RUN DEBIAN_FRONTEND=noninteractive \ + apt update && apt install -y --no-install-recommends \ + autoconf \ + git \ + libtool \ + locales \ + make \ + python-boto \ + rpm \ + ruby \ + ruby-dev \ + zip && \ + rm -rf /var/lib/apt/lists/* + +RUN ln -sf /usr/share/zoneinfo/Etc/UTC /etc/localtime +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