Update to Go 1.16.2 (#8989)
This commit is contained in:
parent
4e9bc06eb2
commit
89f5e8a9d9
|
|
@ -12,7 +12,7 @@ executors:
|
||||||
go-1_16:
|
go-1_16:
|
||||||
working_directory: '/go/src/github.com/influxdata/telegraf'
|
working_directory: '/go/src/github.com/influxdata/telegraf'
|
||||||
docker:
|
docker:
|
||||||
- image: 'quay.io/influxdb/telegraf-ci:1.16.1'
|
- image: 'quay.io/influxdb/telegraf-ci:1.16.2'
|
||||||
environment:
|
environment:
|
||||||
GOFLAGS: -p=8
|
GOFLAGS: -p=8
|
||||||
mac:
|
mac:
|
||||||
|
|
@ -37,14 +37,6 @@ commands:
|
||||||
- run: 'GOARCH=<< parameters.goarch >> make check'
|
- run: 'GOARCH=<< parameters.goarch >> make check'
|
||||||
- run: 'GOARCH=<< parameters.goarch >> make check-deps'
|
- run: 'GOARCH=<< parameters.goarch >> make check-deps'
|
||||||
- run: 'GOARCH=<< parameters.goarch >> make test'
|
- run: 'GOARCH=<< parameters.goarch >> make test'
|
||||||
test-go-mac:
|
|
||||||
steps:
|
|
||||||
- checkout
|
|
||||||
- attach_workspace:
|
|
||||||
at: '/'
|
|
||||||
- run: 'make'
|
|
||||||
- run: 'make check'
|
|
||||||
- run: 'make test'
|
|
||||||
package:
|
package:
|
||||||
parameters:
|
parameters:
|
||||||
nightly:
|
nightly:
|
||||||
|
|
@ -88,31 +80,6 @@ jobs:
|
||||||
root: '/go'
|
root: '/go'
|
||||||
paths:
|
paths:
|
||||||
- '*'
|
- '*'
|
||||||
macdeps:
|
|
||||||
executor: mac
|
|
||||||
steps:
|
|
||||||
- checkout
|
|
||||||
- restore_cache:
|
|
||||||
key: mac-go-mod-v3-{{ checksum "go.sum" }}
|
|
||||||
- run: 'brew update'
|
|
||||||
- run: 'brew install go@1.16'
|
|
||||||
- run: 'make deps'
|
|
||||||
- run: 'make tidy'
|
|
||||||
- save_cache:
|
|
||||||
name: 'go module cache'
|
|
||||||
key: mac-go-mod-v3-{{ checksum "go.sum" }}
|
|
||||||
paths:
|
|
||||||
- '~/go/pkg/mod'
|
|
||||||
- '/usr/local/Cellar/go'
|
|
||||||
- '/usr/local/bin/go'
|
|
||||||
- '/usr/local/bin/gofmt'
|
|
||||||
- persist_to_workspace:
|
|
||||||
root: '/'
|
|
||||||
paths:
|
|
||||||
- 'usr/local/bin/go'
|
|
||||||
- 'usr/local/Cellar/go'
|
|
||||||
- 'usr/local/bin/gofmt'
|
|
||||||
- 'Users/distiller/go'
|
|
||||||
test-go-1_15:
|
test-go-1_15:
|
||||||
executor: go-1_15
|
executor: go-1_15
|
||||||
steps:
|
steps:
|
||||||
|
|
@ -131,17 +98,32 @@ jobs:
|
||||||
steps:
|
steps:
|
||||||
- test-go:
|
- test-go:
|
||||||
goarch: "386"
|
goarch: "386"
|
||||||
test-go-darwin:
|
test-go-mac:
|
||||||
executor: mac
|
executor: mac
|
||||||
steps:
|
steps:
|
||||||
- test-go-mac
|
- checkout
|
||||||
|
- restore_cache:
|
||||||
|
key: mac-go-mod-v0-{{ checksum "go.sum" }}
|
||||||
|
- run: 'sh ./scripts/mac_installgo.sh'
|
||||||
|
- save_cache:
|
||||||
|
name: 'Saving cache'
|
||||||
|
key: mac-go-mod-v0-{{ checksum "go.sum" }}
|
||||||
|
paths:
|
||||||
|
- '/usr/local/Cellar/go'
|
||||||
|
- '/usr/local/bin/go'
|
||||||
|
- '/usr/local/bin/gofmt'
|
||||||
|
- run: 'make deps'
|
||||||
|
- run: 'make tidy'
|
||||||
|
- run: 'make'
|
||||||
|
- run: 'make check'
|
||||||
|
- run: 'make test'
|
||||||
test-go-windows:
|
test-go-windows:
|
||||||
executor:
|
executor:
|
||||||
name: win/default
|
name: win/default
|
||||||
shell: powershell.exe
|
shell: powershell.exe
|
||||||
steps:
|
steps:
|
||||||
- checkout
|
- checkout
|
||||||
- run: choco upgrade golang --version=1.15.8
|
- run: choco upgrade golang --version=1.16.2
|
||||||
- run: choco install make
|
- run: choco install make
|
||||||
- run: git config --system core.longpaths true
|
- run: git config --system core.longpaths true
|
||||||
- run: make test-windows
|
- run: make test-windows
|
||||||
|
|
@ -201,10 +183,6 @@ workflows:
|
||||||
version: 2
|
version: 2
|
||||||
check:
|
check:
|
||||||
jobs:
|
jobs:
|
||||||
- 'macdeps':
|
|
||||||
filters:
|
|
||||||
tags:
|
|
||||||
only: /.*/
|
|
||||||
- 'deps':
|
- 'deps':
|
||||||
filters:
|
filters:
|
||||||
tags:
|
tags:
|
||||||
|
|
@ -233,9 +211,7 @@ workflows:
|
||||||
filters:
|
filters:
|
||||||
tags:
|
tags:
|
||||||
only: /.*/
|
only: /.*/
|
||||||
- 'test-go-darwin':
|
- 'test-go-mac':
|
||||||
requires:
|
|
||||||
- 'macdeps'
|
|
||||||
filters:
|
filters:
|
||||||
tags: # only runs on tags if you specify this filter
|
tags: # only runs on tags if you specify this filter
|
||||||
only: /.*/
|
only: /.*/
|
||||||
|
|
@ -246,7 +222,7 @@ workflows:
|
||||||
- 'package':
|
- 'package':
|
||||||
requires:
|
requires:
|
||||||
- 'test-go-windows'
|
- 'test-go-windows'
|
||||||
- 'test-go-darwin'
|
- 'test-go-mac'
|
||||||
- 'test-go-1_15'
|
- 'test-go-1_15'
|
||||||
- 'test-go-1_15-386'
|
- 'test-go-1_15-386'
|
||||||
- 'test-go-1_16'
|
- 'test-go-1_16'
|
||||||
|
|
@ -254,7 +230,7 @@ workflows:
|
||||||
- 'release':
|
- 'release':
|
||||||
requires:
|
requires:
|
||||||
- 'test-go-windows'
|
- 'test-go-windows'
|
||||||
- 'test-go-darwin'
|
- 'test-go-mac'
|
||||||
- 'test-go-1_15'
|
- 'test-go-1_15'
|
||||||
- 'test-go-1_15-386'
|
- 'test-go-1_15-386'
|
||||||
- 'test-go-1_16'
|
- 'test-go-1_16'
|
||||||
|
|
@ -279,7 +255,6 @@ workflows:
|
||||||
nightly:
|
nightly:
|
||||||
jobs:
|
jobs:
|
||||||
- 'deps'
|
- 'deps'
|
||||||
- 'macdeps'
|
|
||||||
- 'test-go-1_15':
|
- 'test-go-1_15':
|
||||||
requires:
|
requires:
|
||||||
- 'deps'
|
- 'deps'
|
||||||
|
|
@ -292,14 +267,12 @@ workflows:
|
||||||
- 'test-go-1_16-386':
|
- 'test-go-1_16-386':
|
||||||
requires:
|
requires:
|
||||||
- 'deps'
|
- 'deps'
|
||||||
- 'test-go-darwin':
|
- 'test-go-mac'
|
||||||
requires:
|
|
||||||
- 'macdeps'
|
|
||||||
- 'test-go-windows'
|
- 'test-go-windows'
|
||||||
- 'nightly':
|
- 'nightly':
|
||||||
requires:
|
requires:
|
||||||
- 'test-go-windows'
|
- 'test-go-windows'
|
||||||
- 'test-go-darwin'
|
- 'test-go-mac'
|
||||||
- 'test-go-1_15'
|
- 'test-go-1_15'
|
||||||
- 'test-go-1_15-386'
|
- 'test-go-1_15-386'
|
||||||
- 'test-go-1_16'
|
- 'test-go-1_16'
|
||||||
|
|
|
||||||
4
Makefile
4
Makefile
|
|
@ -185,8 +185,8 @@ ci-1.15:
|
||||||
|
|
||||||
.PHONY: ci-1.16
|
.PHONY: ci-1.16
|
||||||
ci-1.16:
|
ci-1.16:
|
||||||
docker build -t quay.io/influxdb/telegraf-ci:1.16.1 - < scripts/ci-1.16.docker
|
docker build -t quay.io/influxdb/telegraf-ci:1.16.2 - < scripts/ci-1.16.docker
|
||||||
docker push quay.io/influxdb/telegraf-ci:1.16.1
|
docker push quay.io/influxdb/telegraf-ci:1.16.2
|
||||||
|
|
||||||
.PHONY: install
|
.PHONY: install
|
||||||
install: $(buildbin)
|
install: $(buildbin)
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
FROM golang:1.16.1 as builder
|
FROM golang:1.16.2 as builder
|
||||||
WORKDIR /go/src/github.com/influxdata/telegraf
|
WORKDIR /go/src/github.com/influxdata/telegraf
|
||||||
|
|
||||||
COPY . /go/src/github.com/influxdata/telegraf
|
COPY . /go/src/github.com/influxdata/telegraf
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
FROM golang:1.16.1-buster as builder
|
FROM golang:1.16.2-buster as builder
|
||||||
WORKDIR /go/src/github.com/influxdata/telegraf
|
WORKDIR /go/src/github.com/influxdata/telegraf
|
||||||
|
|
||||||
COPY . /go/src/github.com/influxdata/telegraf
|
COPY . /go/src/github.com/influxdata/telegraf
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
FROM golang:1.16.1
|
FROM golang:1.16.2
|
||||||
|
|
||||||
RUN chmod -R 755 "$GOPATH"
|
RUN chmod -R 755 "$GOPATH"
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,27 @@
|
||||||
|
#!/bin/sh
|
||||||
|
|
||||||
|
version="1.16.2"
|
||||||
|
# This path is cachable, while saving directly in /usr/local/ will cause issues restoring the cache
|
||||||
|
path="/usr/local/Cellar"
|
||||||
|
|
||||||
|
# Download Go directly from tar, the reason we aren't using brew: it is slow to update and we can't pull specific minor versions
|
||||||
|
setup_go () {
|
||||||
|
echo "installing go"
|
||||||
|
curl -OL https://golang.org/dl/go${version}.darwin-amd64.tar.gz --output go${version}.darwin-amd64.tar.gz
|
||||||
|
sudo rm -rf ${path}/go
|
||||||
|
sudo tar -C $path -xzf go${version}.darwin-amd64.tar.gz
|
||||||
|
ln -sf ${path}/go/bin/go /usr/local/bin/go
|
||||||
|
ln -sf ${path}/go/bin/gofmt /usr/local/bin/gofmt
|
||||||
|
}
|
||||||
|
|
||||||
|
if command -v go &> /dev/null; then
|
||||||
|
echo "Go is already installed"
|
||||||
|
v=`go version | { read _ _ v _; echo ${v#go}; }`
|
||||||
|
echo "$v is installed, required version is $version"
|
||||||
|
if [ "$v" != $version ]; then
|
||||||
|
setup_go
|
||||||
|
go version
|
||||||
|
fi
|
||||||
|
else
|
||||||
|
setup_go
|
||||||
|
fi
|
||||||
Loading…
Reference in New Issue