Skip to content

Commit

Permalink
try with custom script
Browse files Browse the repository at this point in the history
  • Loading branch information
powersj committed Jun 27, 2022
1 parent 29fab41 commit d5c6c8f
Showing 1 changed file with 77 additions and 11 deletions.
88 changes: 77 additions & 11 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
@@ -1,24 +1,90 @@
version: 2.1

executors:
telegraf-ci:
working_directory: '/go/src/github.com/influxdata/telegraf'
resource_class: large
docker:
- image: 'quay.io/influxdb/telegraf-ci:1.18.3'
environment:
GOFLAGS: -p=4

commands:
check-changed-files-or-halt:
steps:
- run: ./scripts/check-file-changes.sh
package-build:
parameters:
type:
type: string
default: ""
nightly:
type: boolean
default: false
steps:
- checkout
- check-changed-files-or-halt
- attach_workspace:
at: '/go'
- when:
condition:
equal: [ windows, << parameters.type >> ]
steps:
- run: make versioninfo
- when:
condition: << parameters.nightly >>
steps:
- run:
command: 'NIGHTLY=1 make package include_packages="$(make << parameters.type >>)"'
no_output_timeout: 30m
- unless:
condition:
or:
- << parameters.nightly >>
steps:
- run:
command: 'make package include_packages="$(make << parameters.type >>)"'
no_output_timeout: 30m
- store_artifacts:
path: './build/dist'
destination: 'build/dist'
- persist_to_workspace:
root: './build'
paths:
- 'dist'

jobs:
setup:
amd64-package:
parameters:
nightly:
type: boolean
default: false
executor: telegraf-ci
steps:
- package-build:
type: amd64
nightly: << parameters.nightly >>

amd64-package-test:
machine:
image: ubuntu-2004:current
steps:
- checkout
- attach_workspace:
at: '.'
- run: sudo apt update && sudo apt install -y snapd
- run: sudo snap install lxd
- run: sudo lxd waitready
- run: sudo lxd init --auto
- run: sudo usermod -a -G lxd $(whoami)
- run: lxc launch ubuntu-daily:j j1
- run: sleep 5
- run: lxc list
- run: lxc info j1
- run: lxc exec j1 -- bash -c "ip a"
- run: lxc exec j1 -- bash -c "sudo apt-get update"
- run: lxc delete --force j1
- run: cd tools/package_lxd_test && go build
- run: ./tools/package_lxd_test/package_lxd_test --package $(find ./dist -name "*_amd64.deb")
- run: ./tools/package_lxd_test/package_lxd_test --package $(find ./dist -name "*.x86_64.rpm")

workflows:
setup:
version: 2
check:
jobs:
- setup
- 'amd64-package'
- 'amd64-package-test':
requires:
- 'amd64-package'

0 comments on commit d5c6c8f

Please sign in to comment.