Skip to content

Commit

Permalink
Upgrade circle-ci config to v2.1 (#8621)
Browse files Browse the repository at this point in the history
* Upgrade to 2.1 circle-ci config

* new line

(cherry picked from commit c8584a7)
  • Loading branch information
sspaink authored and ssoroka committed Jan 27, 2021
1 parent 17000bc commit 3595b6e
Show file tree
Hide file tree
Showing 4 changed files with 107 additions and 88 deletions.
186 changes: 99 additions & 87 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
@@ -1,27 +1,72 @@
---
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'
environment:
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:
Expand All @@ -38,7 +83,7 @@ jobs:
paths:
- '*'
macdeps:
<<: [ *mac ]
executor: mac
steps:
- checkout
- restore_cache:
Expand All @@ -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
Expand All @@ -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:
Expand All @@ -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: /.*/
Expand All @@ -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':
Expand All @@ -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 * * *"
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,4 @@
/telegraf.gz
/vendor
.DS_Store
process.yml
2 changes: 1 addition & 1 deletion plugins/outputs/sumologic/sumologic.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
6 changes: 6 additions & 0 deletions scripts/local_circleci.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
#!/bin/sh

jobName=$1

circleci config process .circleci/config.yml > process.yml
circleci local execute -c process.yml --job $jobName

0 comments on commit 3595b6e

Please sign in to comment.