Upgrade circle-ci config to v2.1 (#8621)

* Upgrade to 2.1 circle-ci config

* new line
This commit is contained in:
Sebastian Spaink 2021-01-06 16:23:29 -06:00 committed by GitHub
parent 4608620924
commit c8584a7b3f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 107 additions and 88 deletions

View File

@ -1,16 +1,19 @@
---
defaults:
defaults: &defaults
version: 2.1
executors:
go-1_14:
working_directory: '/go/src/github.com/influxdata/telegraf'
environment:
GOFLAGS: -p=8
go-1_14: &go-1_14
docker:
- image: 'quay.io/influxdb/telegraf-ci:1.14.9'
go-1_15: &go-1_15
environment:
GOFLAGS: -p=8
go-1_15:
working_directory: '/go/src/github.com/influxdata/telegraf'
docker:
- image: 'quay.io/influxdb/telegraf-ci:1.15.5'
mac: &mac
environment:
GOFLAGS: -p=8
mac:
macos:
xcode: 12.1.0
working_directory: '~/go/src/github.com/influxdata/telegraf'
@ -18,10 +21,52 @@ defaults:
HOMEBREW_NO_AUTO_UPDATE: 1
GOFLAGS: -p=8
version: 2
commands:
test-go:
parameters:
goarch:
type: string
default: "amd64"
steps:
- checkout
- attach_workspace:
at: '/go'
- run: 'GOARCH=<< parameters.goarch >> make'
- run: 'GOARCH=<< parameters.goarch >> make check'
- run: 'GOARCH=<< parameters.goarch >> make check-deps'
- run: 'GOARCH=<< parameters.goarch >> make test'
test-go-mac:
steps:
- checkout
- attach_workspace:
at: '/'
- run: 'make'
- run: 'make check'
- run: 'make test'
package:
parameters:
nightly:
type: boolean
default: false
steps:
- checkout
- attach_workspace:
at: '/go'
- when:
condition: << parameters.nightly >>
steps:
- run: 'NIGHTLY=1 make package'
- run: 'make upload-nightly'
- unless:
condition: << parameters.nightly >>
steps:
- run: 'make package'
- store_artifacts:
path: './build/dist'
destination: 'build/dist'
jobs:
deps:
<<: [ *defaults, *go-1_15 ]
executor: go-1_15
steps:
- checkout
- restore_cache:
@ -38,7 +83,7 @@ jobs:
paths:
- '*'
macdeps:
<<: [ *mac ]
executor: mac
steps:
- checkout
- restore_cache:
@ -62,75 +107,42 @@ jobs:
- 'usr/local/bin/gofmt'
- 'Users/distiller/go'
test-go-1.14:
<<: [ *defaults, *go-1_14 ]
test-go-1_14:
executor: go-1_14
steps:
- attach_workspace:
at: '/go'
- run: 'make'
- run: 'make test'
test-go-1.14-386:
<<: [ *defaults, *go-1_14 ]
- test-go
test-go-1_14-386:
executor: go-1_14
steps:
- attach_workspace:
at: '/go'
- run: 'GOARCH=386 make'
- run: 'GOARCH=386 make test'
test-go-1.15:
<<: [ *defaults, *go-1_15 ]
- test-go:
goarch: "386"
test-go-1_15:
executor: go-1_15
steps:
- attach_workspace:
at: '/go'
- run: 'make'
- run: 'make check'
- run: 'make check-deps'
- run: 'make test'
test-go-1.15-386:
<<: [ *defaults, *go-1_15 ]
- test-go
test-go-1_15-386:
executor: go-1_15
steps:
- attach_workspace:
at: '/go'
- run: 'GOARCH=386 make'
- run: 'GOARCH=386 make check'
- run: 'GOARCH=386 make test'
- test-go:
goarch: "386"
test-go-darwin:
<<: [ *mac ]
executor: mac
steps:
- attach_workspace:
at: '/'
- run: 'make'
- run: 'make check'
- run: 'make test'
- test-go-mac
package:
<<: [ *defaults, *go-1_15 ]
executor: go-1_15
steps:
- attach_workspace:
at: '/go'
- run: 'make package'
- store_artifacts:
path: './build/dist'
destination: 'build/dist'
- package
release:
<<: [ *defaults, *go-1_15 ]
executor: go-1_15
steps:
- attach_workspace:
at: '/go'
- run: 'make package'
- store_artifacts:
path: './build/dist'
destination: 'build/dist'
- package
nightly:
<<: [ *defaults, *go-1_15 ]
executor: go-1_15
steps:
- attach_workspace:
at: '/go'
- run: 'NIGHTLY=1 make package'
- run: 'make upload-nightly'
- store_artifacts:
path: './build/dist'
destination: 'build/dist'
- package:
nightly: true
workflows:
version: 2
@ -144,25 +156,25 @@ workflows:
filters:
tags:
only: /.*/
- 'test-go-1.14':
- 'test-go-1_14':
requires:
- 'deps'
filters:
tags:
only: /.*/
- 'test-go-1.14-386':
- 'test-go-1_14-386':
requires:
- 'deps'
filters:
tags:
only: /.*/
- 'test-go-1.15':
- 'test-go-1_15':
requires:
- 'deps'
filters:
tags:
only: /.*/
- 'test-go-1.15-386':
- 'test-go-1_15-386':
requires:
- 'deps'
filters:
@ -177,17 +189,17 @@ workflows:
- 'package':
requires:
- 'test-go-darwin'
- 'test-go-1.14'
- 'test-go-1.14-386'
- 'test-go-1.15'
- 'test-go-1.15-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.14'
- 'test-go-1.14-386'
- 'test-go-1.15'
- 'test-go-1.15-386'
- 'test-go-1_14'
- 'test-go-1_14-386'
- 'test-go-1_15'
- 'test-go-1_15-386'
filters:
tags:
only: /.*/
@ -197,16 +209,16 @@ workflows:
jobs:
- 'deps'
- 'macdeps'
- 'test-go-1.14':
- 'test-go-1_14':
requires:
- 'deps'
- 'test-go-1.14-386':
- 'test-go-1_14-386':
requires:
- 'deps'
- 'test-go-1.15':
- 'test-go-1_15':
requires:
- 'deps'
- 'test-go-1.15-386':
- 'test-go-1_15-386':
requires:
- 'deps'
- 'test-go-darwin':
@ -215,10 +227,10 @@ workflows:
- 'nightly':
requires:
- 'test-go-darwin'
- 'test-go-1.14'
- 'test-go-1.14-386'
- 'test-go-1.15'
- 'test-go-1.15-386'
- 'test-go-1_14'
- 'test-go-1_14-386'
- 'test-go-1_15'
- 'test-go-1_15-386'
triggers:
- schedule:
cron: "0 7 * * *"

1
.gitignore vendored
View File

@ -5,3 +5,4 @@
/telegraf.gz
/vendor
.DS_Store
process.yml

View File

@ -75,7 +75,7 @@ const (
defaultClientTimeout = 5 * time.Second
defaultMethod = http.MethodPost
defaultMaxRequestBodySize = 1_000_000
defaultMaxRequestBodySize = 1000000
contentTypeHeader = "Content-Type"
carbon2ContentType = "application/vnd.sumologic.carbon2"

6
scripts/local_circleci.sh Executable file
View File

@ -0,0 +1,6 @@
#!/bin/sh
jobName=$1
circleci config process .circleci/config.yml > process.yml
circleci local execute -c process.yml --job $jobName