81 lines
1.7 KiB
YAML
81 lines
1.7 KiB
YAML
---
|
|
version: 2.1
|
|
|
|
orbs:
|
|
prometheus: prometheus/prometheus@0.16.0
|
|
codecov: codecov/codecov@3.2.2
|
|
|
|
executors:
|
|
# Whenever the Go version is updated here, .promu.yml should
|
|
# also be updated.
|
|
golang:
|
|
docker:
|
|
- image: circleci/golang:1.17
|
|
|
|
jobs:
|
|
test:
|
|
executor: golang
|
|
steps:
|
|
- prometheus/setup_environment
|
|
- run: make
|
|
- run: make coverage
|
|
- codecov/upload:
|
|
file: coverage.txt
|
|
- prometheus/store_artifact:
|
|
file: cgroup_exporter
|
|
build:
|
|
machine:
|
|
image: ubuntu-2004:202201-02
|
|
steps:
|
|
- checkout
|
|
- run: make promu
|
|
- run: promu crossbuild -v
|
|
- persist_to_workspace:
|
|
root: .
|
|
paths:
|
|
- .build
|
|
- store_artifacts:
|
|
path: .build
|
|
destination: /build
|
|
- run:
|
|
command: |
|
|
if [ -n "$CIRCLE_TAG" ]; then
|
|
make docker DOCKER_IMAGE_TAG=$CIRCLE_TAG
|
|
else
|
|
make docker
|
|
fi
|
|
workflows:
|
|
version: 2
|
|
cgroup_exporter:
|
|
jobs:
|
|
- test:
|
|
filters:
|
|
tags:
|
|
only: /.*/
|
|
- build:
|
|
filters:
|
|
tags:
|
|
only: /.*/
|
|
- prometheus/publish_master:
|
|
context: org-context
|
|
docker_hub_organization: treydock
|
|
quay_io_organization: treydock
|
|
requires:
|
|
- test
|
|
- build
|
|
filters:
|
|
branches:
|
|
only: master
|
|
- prometheus/publish_release:
|
|
context: org-context
|
|
docker_hub_organization: treydock
|
|
quay_io_organization: treydock
|
|
requires:
|
|
- test
|
|
- build
|
|
filters:
|
|
tags:
|
|
only: /^v([0-9]).*/
|
|
branches:
|
|
ignore: /.*/
|