From c8584a7b3f4383e49e7aa9adbbe4b4663b5a27c4 Mon Sep 17 00:00:00 2001 From: Sebastian Spaink <3441183+sspaink@users.noreply.github.com> Date: Wed, 6 Jan 2021 16:23:29 -0600 Subject: [PATCH] Upgrade circle-ci config to v2.1 (#8621) * Upgrade to 2.1 circle-ci config * new line --- .circleci/config.yml | 186 +++++++++++++------------ .gitignore | 1 + plugins/outputs/sumologic/sumologic.go | 2 +- scripts/local_circleci.sh | 6 + 4 files changed, 107 insertions(+), 88 deletions(-) create mode 100755 scripts/local_circleci.sh diff --git a/.circleci/config.yml b/.circleci/config.yml index 2b55149d0abc2..5e44cfe59f4c2 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -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 * * *" diff --git a/.gitignore b/.gitignore index df2b3d06643c5..c733e317ce1a7 100644 --- a/.gitignore +++ b/.gitignore @@ -5,3 +5,4 @@ /telegraf.gz /vendor .DS_Store +process.yml diff --git a/plugins/outputs/sumologic/sumologic.go b/plugins/outputs/sumologic/sumologic.go index fd9fe908ba099..da86eadfae585 100644 --- a/plugins/outputs/sumologic/sumologic.go +++ b/plugins/outputs/sumologic/sumologic.go @@ -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" diff --git a/scripts/local_circleci.sh b/scripts/local_circleci.sh new file mode 100755 index 0000000000000..87623713d605e --- /dev/null +++ b/scripts/local_circleci.sh @@ -0,0 +1,6 @@ +#!/bin/sh + +jobName=$1 + +circleci config process .circleci/config.yml > process.yml +circleci local execute -c process.yml --job $jobName