2021-01-07 06:23:29 +08:00
|
|
|
version: 2.1
|
2021-02-11 01:28:57 +08:00
|
|
|
orbs:
|
|
|
|
|
win: circleci/windows@2.4.0
|
2021-03-18 02:52:26 +08:00
|
|
|
aws-cli: circleci/aws-cli@1.4.0
|
2021-01-07 06:23:29 +08:00
|
|
|
|
|
|
|
|
executors:
|
2021-03-09 06:29:11 +08:00
|
|
|
go-1_15:
|
2018-04-19 07:14:06 +08:00
|
|
|
working_directory: '/go/src/github.com/influxdata/telegraf'
|
2020-05-27 06:40:25 +08:00
|
|
|
docker:
|
2021-03-09 06:29:11 +08:00
|
|
|
- image: 'quay.io/influxdb/telegraf-ci:1.15.8'
|
2021-01-07 06:23:29 +08:00
|
|
|
environment:
|
|
|
|
|
GOFLAGS: -p=8
|
2021-03-09 06:29:11 +08:00
|
|
|
go-1_16:
|
2021-01-07 06:23:29 +08:00
|
|
|
working_directory: '/go/src/github.com/influxdata/telegraf'
|
2020-10-08 02:51:49 +08:00
|
|
|
docker:
|
2021-03-17 03:23:44 +08:00
|
|
|
- image: 'quay.io/influxdb/telegraf-ci:1.16.2'
|
2021-01-07 06:23:29 +08:00
|
|
|
environment:
|
|
|
|
|
GOFLAGS: -p=8
|
|
|
|
|
mac:
|
2020-02-21 06:23:13 +08:00
|
|
|
macos:
|
2021-03-09 06:29:11 +08:00
|
|
|
xcode: 12.4.0
|
2020-02-21 06:23:13 +08:00
|
|
|
working_directory: '~/go/src/github.com/influxdata/telegraf'
|
|
|
|
|
environment:
|
|
|
|
|
HOMEBREW_NO_AUTO_UPDATE: 1
|
|
|
|
|
GOFLAGS: -p=8
|
2020-02-26 04:05:44 +08:00
|
|
|
|
2021-01-07 06:23:29 +08:00
|
|
|
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'
|
|
|
|
|
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'
|
2021-02-12 05:24:06 +08:00
|
|
|
- persist_to_workspace:
|
|
|
|
|
root: './build'
|
|
|
|
|
paths:
|
|
|
|
|
- 'dist'
|
2018-02-02 07:05:39 +08:00
|
|
|
jobs:
|
2018-04-19 07:14:06 +08:00
|
|
|
deps:
|
2021-03-09 06:29:11 +08:00
|
|
|
executor: go-1_16
|
2018-02-02 07:05:39 +08:00
|
|
|
steps:
|
|
|
|
|
- checkout
|
2018-06-20 02:55:38 +08:00
|
|
|
- restore_cache:
|
2020-01-17 06:38:06 +08:00
|
|
|
key: go-mod-v1-{{ checksum "go.sum" }}
|
2018-04-03 05:13:15 +08:00
|
|
|
- run: 'make deps'
|
2020-01-17 06:38:06 +08:00
|
|
|
- run: 'make tidy'
|
2018-06-20 02:55:38 +08:00
|
|
|
- save_cache:
|
2020-01-17 06:38:06 +08:00
|
|
|
name: 'go module cache'
|
|
|
|
|
key: go-mod-v1-{{ checksum "go.sum" }}
|
2018-06-20 02:55:38 +08:00
|
|
|
paths:
|
2020-01-17 06:38:06 +08:00
|
|
|
- '/go/pkg/mod'
|
2018-04-19 07:14:06 +08:00
|
|
|
- persist_to_workspace:
|
2020-01-17 06:38:06 +08:00
|
|
|
root: '/go'
|
2018-04-19 07:14:06 +08:00
|
|
|
paths:
|
|
|
|
|
- '*'
|
2021-03-09 06:29:11 +08:00
|
|
|
test-go-1_15:
|
|
|
|
|
executor: go-1_15
|
2018-07-25 05:57:24 +08:00
|
|
|
steps:
|
2021-01-07 06:23:29 +08:00
|
|
|
- test-go
|
2021-03-09 06:29:11 +08:00
|
|
|
test-go-1_15-386:
|
|
|
|
|
executor: go-1_15
|
2019-05-30 09:54:44 +08:00
|
|
|
steps:
|
2021-01-07 06:23:29 +08:00
|
|
|
- test-go:
|
|
|
|
|
goarch: "386"
|
2021-03-09 06:29:11 +08:00
|
|
|
test-go-1_16:
|
|
|
|
|
executor: go-1_16
|
2019-10-08 12:08:28 +08:00
|
|
|
steps:
|
2021-01-07 06:23:29 +08:00
|
|
|
- test-go
|
2021-03-09 06:29:11 +08:00
|
|
|
test-go-1_16-386:
|
|
|
|
|
executor: go-1_16
|
2018-10-20 02:01:31 +08:00
|
|
|
steps:
|
2021-01-07 06:23:29 +08:00
|
|
|
- test-go:
|
|
|
|
|
goarch: "386"
|
2021-03-17 03:23:44 +08:00
|
|
|
test-go-mac:
|
2021-01-07 06:23:29 +08:00
|
|
|
executor: mac
|
2020-02-21 06:23:13 +08:00
|
|
|
steps:
|
2021-03-17 03:23:44 +08:00
|
|
|
- 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'
|
2021-02-11 01:28:57 +08:00
|
|
|
test-go-windows:
|
|
|
|
|
executor:
|
|
|
|
|
name: win/default
|
|
|
|
|
shell: powershell.exe
|
|
|
|
|
steps:
|
|
|
|
|
- checkout
|
2021-03-17 03:23:44 +08:00
|
|
|
- run: choco upgrade golang --version=1.16.2
|
2021-02-11 01:28:57 +08:00
|
|
|
- run: choco install make
|
|
|
|
|
- run: git config --system core.longpaths true
|
|
|
|
|
- run: make test-windows
|
2020-02-26 04:05:44 +08:00
|
|
|
|
2018-07-25 05:57:24 +08:00
|
|
|
package:
|
2021-03-09 06:29:11 +08:00
|
|
|
executor: go-1_16
|
2018-07-25 05:57:24 +08:00
|
|
|
steps:
|
2021-01-07 06:23:29 +08:00
|
|
|
- package
|
2018-02-02 07:05:39 +08:00
|
|
|
release:
|
2021-03-09 06:29:11 +08:00
|
|
|
executor: go-1_16
|
2018-02-02 07:05:39 +08:00
|
|
|
steps:
|
2021-01-07 06:23:29 +08:00
|
|
|
- package
|
2018-02-02 07:05:39 +08:00
|
|
|
nightly:
|
2021-03-09 06:29:11 +08:00
|
|
|
executor: go-1_16
|
2018-02-02 07:05:39 +08:00
|
|
|
steps:
|
2021-01-07 06:23:29 +08:00
|
|
|
- package:
|
|
|
|
|
nightly: true
|
2021-02-12 05:24:06 +08:00
|
|
|
package-sign-windows:
|
|
|
|
|
executor:
|
|
|
|
|
name: win/default
|
|
|
|
|
shell: powershell.exe
|
|
|
|
|
steps:
|
|
|
|
|
- checkout
|
|
|
|
|
- attach_workspace:
|
|
|
|
|
at: '/build'
|
|
|
|
|
- run:
|
|
|
|
|
name: "Sign Windows Executables"
|
|
|
|
|
shell: powershell.exe
|
|
|
|
|
command: |
|
|
|
|
|
./scripts/windows-signing.ps1
|
2021-03-05 23:14:01 +08:00
|
|
|
- persist_to_workspace:
|
|
|
|
|
root: './build'
|
|
|
|
|
paths:
|
|
|
|
|
- 'dist'
|
2021-02-12 05:24:06 +08:00
|
|
|
- store_artifacts:
|
|
|
|
|
path: './build/dist'
|
|
|
|
|
destination: 'build/dist'
|
2021-03-05 23:14:01 +08:00
|
|
|
package-sign-mac:
|
|
|
|
|
macos:
|
|
|
|
|
xcode: "11.3"
|
|
|
|
|
working_directory: /Users/distiller/project
|
|
|
|
|
environment:
|
|
|
|
|
FL_OUTPUT_DIR: output
|
|
|
|
|
FASTLANE_LANE: test
|
|
|
|
|
shell: /bin/bash --login -o pipefail
|
|
|
|
|
steps:
|
|
|
|
|
- checkout
|
|
|
|
|
- attach_workspace:
|
|
|
|
|
at: '.'
|
|
|
|
|
- run:
|
|
|
|
|
command: |
|
|
|
|
|
sh ./scripts/mac-signing.sh
|
|
|
|
|
- store_artifacts:
|
|
|
|
|
path: './dist'
|
|
|
|
|
destination: 'build/dist'
|
2021-03-18 02:52:26 +08:00
|
|
|
share-artifacts:
|
|
|
|
|
executor: aws-cli/default
|
|
|
|
|
steps:
|
|
|
|
|
- run:
|
|
|
|
|
command: |
|
|
|
|
|
PR=${CIRCLE_PULL_REQUEST##*/}
|
|
|
|
|
printf -v payload '{ "pullRequestNumber": "%s" }' "$PR"
|
2021-03-19 05:31:31 +08:00
|
|
|
curl -X POST "https://182c7jdgog.execute-api.us-east-1.amazonaws.com/prod/shareArtifacts" --data "$payload"
|
|
|
|
|
|
2018-02-02 07:05:39 +08:00
|
|
|
workflows:
|
|
|
|
|
version: 2
|
2018-07-25 05:57:24 +08:00
|
|
|
check:
|
2018-02-02 07:05:39 +08:00
|
|
|
jobs:
|
2018-07-25 05:57:24 +08:00
|
|
|
- 'deps':
|
|
|
|
|
filters:
|
|
|
|
|
tags:
|
|
|
|
|
only: /.*/
|
2021-03-09 06:29:11 +08:00
|
|
|
- 'test-go-1_15':
|
2018-04-19 07:14:06 +08:00
|
|
|
requires:
|
|
|
|
|
- 'deps'
|
2018-07-25 05:57:24 +08:00
|
|
|
filters:
|
|
|
|
|
tags:
|
|
|
|
|
only: /.*/
|
2021-03-09 06:29:11 +08:00
|
|
|
- 'test-go-1_15-386':
|
2018-10-20 02:01:31 +08:00
|
|
|
requires:
|
|
|
|
|
- 'deps'
|
|
|
|
|
filters:
|
|
|
|
|
tags:
|
|
|
|
|
only: /.*/
|
2021-03-09 06:29:11 +08:00
|
|
|
- 'test-go-1_16':
|
2019-05-30 09:54:44 +08:00
|
|
|
requires:
|
|
|
|
|
- 'deps'
|
|
|
|
|
filters:
|
|
|
|
|
tags:
|
|
|
|
|
only: /.*/
|
2021-03-09 06:29:11 +08:00
|
|
|
- 'test-go-1_16-386':
|
2018-07-25 05:57:24 +08:00
|
|
|
requires:
|
|
|
|
|
- 'deps'
|
|
|
|
|
filters:
|
|
|
|
|
tags:
|
|
|
|
|
only: /.*/
|
2021-03-17 03:23:44 +08:00
|
|
|
- 'test-go-mac':
|
2020-02-21 06:23:13 +08:00
|
|
|
filters:
|
|
|
|
|
tags: # only runs on tags if you specify this filter
|
|
|
|
|
only: /.*/
|
2021-02-11 01:28:57 +08:00
|
|
|
- 'test-go-windows':
|
|
|
|
|
filters:
|
|
|
|
|
tags:
|
|
|
|
|
only: /.*/
|
2018-07-25 05:57:24 +08:00
|
|
|
- 'package':
|
|
|
|
|
requires:
|
2021-02-11 01:28:57 +08:00
|
|
|
- 'test-go-windows'
|
2021-03-17 03:23:44 +08:00
|
|
|
- 'test-go-mac'
|
2021-01-07 06:23:29 +08:00
|
|
|
- 'test-go-1_15'
|
|
|
|
|
- 'test-go-1_15-386'
|
2021-03-09 06:29:11 +08:00
|
|
|
- 'test-go-1_16'
|
|
|
|
|
- 'test-go-1_16-386'
|
2021-03-18 02:52:26 +08:00
|
|
|
- 'share-artifacts':
|
|
|
|
|
requires:
|
|
|
|
|
- 'package'
|
|
|
|
|
filters:
|
|
|
|
|
branches:
|
|
|
|
|
ignore:
|
|
|
|
|
- master
|
2018-02-02 07:05:39 +08:00
|
|
|
- 'release':
|
|
|
|
|
requires:
|
2021-02-11 01:28:57 +08:00
|
|
|
- 'test-go-windows'
|
2021-03-17 03:23:44 +08:00
|
|
|
- 'test-go-mac'
|
2021-01-07 06:23:29 +08:00
|
|
|
- 'test-go-1_15'
|
|
|
|
|
- 'test-go-1_15-386'
|
2021-03-09 06:29:11 +08:00
|
|
|
- 'test-go-1_16'
|
|
|
|
|
- 'test-go-1_16-386'
|
2018-07-25 05:57:24 +08:00
|
|
|
filters:
|
|
|
|
|
tags:
|
|
|
|
|
only: /.*/
|
|
|
|
|
branches:
|
|
|
|
|
ignore: /.*/
|
2021-02-12 05:24:06 +08:00
|
|
|
- 'package-sign-windows':
|
|
|
|
|
requires:
|
|
|
|
|
- 'release'
|
2021-03-05 23:14:01 +08:00
|
|
|
filters:
|
|
|
|
|
tags:
|
|
|
|
|
only: /.*/
|
|
|
|
|
- 'package-sign-mac':
|
|
|
|
|
requires:
|
|
|
|
|
- 'package-sign-windows'
|
|
|
|
|
filters:
|
|
|
|
|
tags:
|
|
|
|
|
only: /.*/
|
2018-02-02 07:05:39 +08:00
|
|
|
nightly:
|
|
|
|
|
jobs:
|
2018-04-19 07:14:06 +08:00
|
|
|
- 'deps'
|
2021-03-09 06:29:11 +08:00
|
|
|
- 'test-go-1_15':
|
2018-04-19 07:14:06 +08:00
|
|
|
requires:
|
|
|
|
|
- 'deps'
|
2021-03-09 06:29:11 +08:00
|
|
|
- 'test-go-1_15-386':
|
2018-10-20 02:01:31 +08:00
|
|
|
requires:
|
|
|
|
|
- 'deps'
|
2021-03-09 06:29:11 +08:00
|
|
|
- 'test-go-1_16':
|
2019-05-30 09:54:44 +08:00
|
|
|
requires:
|
|
|
|
|
- 'deps'
|
2021-03-09 06:29:11 +08:00
|
|
|
- 'test-go-1_16-386':
|
2018-07-25 05:57:24 +08:00
|
|
|
requires:
|
|
|
|
|
- 'deps'
|
2021-03-17 03:23:44 +08:00
|
|
|
- 'test-go-mac'
|
2021-02-11 01:28:57 +08:00
|
|
|
- 'test-go-windows'
|
2018-02-03 04:29:54 +08:00
|
|
|
- 'nightly':
|
|
|
|
|
requires:
|
2021-02-11 01:28:57 +08:00
|
|
|
- 'test-go-windows'
|
2021-03-17 03:23:44 +08:00
|
|
|
- 'test-go-mac'
|
2021-01-07 06:23:29 +08:00
|
|
|
- 'test-go-1_15'
|
|
|
|
|
- 'test-go-1_15-386'
|
2021-03-09 06:29:11 +08:00
|
|
|
- 'test-go-1_16'
|
|
|
|
|
- 'test-go-1_16-386'
|
2018-02-02 07:05:39 +08:00
|
|
|
triggers:
|
|
|
|
|
- schedule:
|
2018-04-25 04:42:42 +08:00
|
|
|
cron: "0 7 * * *"
|
2018-02-02 07:05:39 +08:00
|
|
|
filters:
|
|
|
|
|
branches:
|
|
|
|
|
only:
|
2021-03-05 23:14:01 +08:00
|
|
|
- master
|