Test and build official packages with Go 1.12 (#5923)

This commit is contained in:
Daniel Nelson 2019-05-29 18:54:44 -07:00 committed by GitHub
parent dd6a3dbafc
commit 59d646a8e8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 72 additions and 17 deletions

View File

@ -10,12 +10,15 @@ defaults:
- image: 'quay.io/influxdb/telegraf-ci:1.10.8' - image: 'quay.io/influxdb/telegraf-ci:1.10.8'
go-1_11: &go-1_11 go-1_11: &go-1_11
docker: docker:
- image: 'quay.io/influxdb/telegraf-ci:1.11.5' - image: 'quay.io/influxdb/telegraf-ci:1.11.10'
go-1_12: &go-1_12
docker:
- image: 'quay.io/influxdb/telegraf-ci:1.12.5'
version: 2 version: 2
jobs: jobs:
deps: deps:
<<: [ *defaults, *go-1_11 ] <<: [ *defaults, *go-1_12 ]
steps: steps:
- checkout - checkout
- restore_cache: - restore_cache:
@ -55,8 +58,15 @@ jobs:
at: '/go/src' at: '/go/src'
- run: 'make check' - run: 'make check'
- run: 'make test' - run: 'make test'
test-go-1.11-386: test-go-1.12:
<<: [ *defaults, *go-1_11 ] <<: [ *defaults, *go-1_12 ]
steps:
- attach_workspace:
at: '/go/src'
- run: 'GOARCH=386 make check'
- run: 'GOARCH=386 make test'
test-go-1.12-386:
<<: [ *defaults, *go-1_12 ]
steps: steps:
- attach_workspace: - attach_workspace:
at: '/go/src' at: '/go/src'
@ -64,7 +74,7 @@ jobs:
- run: 'GOARCH=386 make test' - run: 'GOARCH=386 make test'
package: package:
<<: [ *defaults, *go-1_11 ] <<: [ *defaults, *go-1_12 ]
steps: steps:
- attach_workspace: - attach_workspace:
at: '/go/src' at: '/go/src'
@ -73,7 +83,7 @@ jobs:
path: './build' path: './build'
destination: 'build' destination: 'build'
release: release:
<<: [ *defaults, *go-1_11 ] <<: [ *defaults, *go-1_12 ]
steps: steps:
- attach_workspace: - attach_workspace:
at: '/go/src' at: '/go/src'
@ -82,7 +92,7 @@ jobs:
path: './build' path: './build'
destination: 'build' destination: 'build'
nightly: nightly:
<<: [ *defaults, *go-1_11 ] <<: [ *defaults, *go-1_12 ]
steps: steps:
- attach_workspace: - attach_workspace:
at: '/go/src' at: '/go/src'
@ -117,7 +127,13 @@ workflows:
filters: filters:
tags: tags:
only: /.*/ only: /.*/
- 'test-go-1.11-386': - 'test-go-1.12':
requires:
- 'deps'
filters:
tags:
only: /.*/
- 'test-go-1.12-386':
requires: requires:
- 'deps' - 'deps'
filters: filters:
@ -128,13 +144,15 @@ workflows:
- 'test-go-1.9' - 'test-go-1.9'
- 'test-go-1.10' - 'test-go-1.10'
- 'test-go-1.11' - 'test-go-1.11'
- 'test-go-1.11-386' - 'test-go-1.12'
- 'test-go-1.12-386'
- 'release': - 'release':
requires: requires:
- 'test-go-1.9' - 'test-go-1.9'
- 'test-go-1.10' - 'test-go-1.10'
- 'test-go-1.11' - 'test-go-1.11'
- 'test-go-1.11-386' - 'test-go-1.12'
- 'test-go-1.12-386'
filters: filters:
tags: tags:
only: /.*/ only: /.*/
@ -152,7 +170,10 @@ workflows:
- 'test-go-1.11': - 'test-go-1.11':
requires: requires:
- 'deps' - 'deps'
- 'test-go-1.11-386': - 'test-go-1.12':
requires:
- 'deps'
- 'test-go-1.12-386':
requires: requires:
- 'deps' - 'deps'
- 'nightly': - 'nightly':
@ -160,7 +181,8 @@ workflows:
- 'test-go-1.9' - 'test-go-1.9'
- 'test-go-1.10' - 'test-go-1.10'
- 'test-go-1.11' - 'test-go-1.11'
- 'test-go-1.11-386' - 'test-go-1.12'
- 'test-go-1.12-386'
triggers: triggers:
- schedule: - schedule:
cron: "0 7 * * *" cron: "0 7 * * *"

View File

@ -131,10 +131,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.12
ci-1.11:
docker build -t quay.io/influxdb/telegraf-ci:1.12.5 - < scripts/ci-1.12.docker
docker push quay.io/influxdb/telegraf-ci:1.12.5
.PHONY: ci-1.11 .PHONY: ci-1.11
ci-1.11: ci-1.11:
docker build -t quay.io/influxdb/telegraf-ci:1.11.5 - < scripts/ci-1.11.docker docker build -t quay.io/influxdb/telegraf-ci:1.11.10 - < scripts/ci-1.11.docker
docker push quay.io/influxdb/telegraf-ci:1.11.5 docker push quay.io/influxdb/telegraf-ci:1.11.10
.PHONY: ci-1.10 .PHONY: ci-1.10
ci-1.10: ci-1.10:

View File

@ -13,11 +13,11 @@ platform: x64
install: install:
- IF NOT EXIST "C:\Cache" mkdir C:\Cache - IF NOT EXIST "C:\Cache" mkdir C:\Cache
- IF NOT EXIST "C:\Cache\go1.11.5.msi" curl -o "C:\Cache\go1.11.5.msi" https://storage.googleapis.com/golang/go1.11.5.windows-amd64.msi - IF NOT EXIST "C:\Cache\go1.12.5.msi" curl -o "C:\Cache\go1.12.5.msi" https://storage.googleapis.com/golang/go1.12.5.windows-amd64.msi
- IF NOT EXIST "C:\Cache\gnuwin32-bin.zip" curl -o "C:\Cache\gnuwin32-bin.zip" https://dl.influxdata.com/telegraf/ci/make-3.81-bin.zip - IF NOT EXIST "C:\Cache\gnuwin32-bin.zip" curl -o "C:\Cache\gnuwin32-bin.zip" https://dl.influxdata.com/telegraf/ci/make-3.81-bin.zip
- IF NOT EXIST "C:\Cache\gnuwin32-dep.zip" curl -o "C:\Cache\gnuwin32-dep.zip" https://dl.influxdata.com/telegraf/ci/make-3.81-dep.zip - IF NOT EXIST "C:\Cache\gnuwin32-dep.zip" curl -o "C:\Cache\gnuwin32-dep.zip" https://dl.influxdata.com/telegraf/ci/make-3.81-dep.zip
- IF EXIST "C:\Go" rmdir /S /Q C:\Go - IF EXIST "C:\Go" rmdir /S /Q C:\Go
- msiexec.exe /i "C:\Cache\go1.11.5.msi" /quiet - msiexec.exe /i "C:\Cache\go1.12.5.msi" /quiet
- 7z x "C:\Cache\gnuwin32-bin.zip" -oC:\GnuWin32 -y - 7z x "C:\Cache\gnuwin32-bin.zip" -oC:\GnuWin32 -y
- 7z x "C:\Cache\gnuwin32-dep.zip" -oC:\GnuWin32 -y - 7z x "C:\Cache\gnuwin32-dep.zip" -oC:\GnuWin32 -y
- go get -d github.com/golang/dep - go get -d github.com/golang/dep

View File

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

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

@ -0,0 +1,28 @@
FROM golang:1.12.5
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