Add Go 1.11 CI support (#4859)

This commit is contained in:
Trevor Pounds 2018-10-19 14:01:31 -04:00 committed by Daniel Nelson
parent 42483b39ec
commit 1ec12ba6ad
3 changed files with 69 additions and 12 deletions

View File

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

View File

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

28
scripts/ci-1.11.docker Normal file
View File

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