97 lines
2.1 KiB
YAML
97 lines
2.1 KiB
YAML
---
|
|
version: 2.1
|
|
|
|
orbs:
|
|
prometheus: prometheus/prometheus@0.4.0
|
|
|
|
executors:
|
|
# Whenever the Go version is updated here, .promu.yml should
|
|
# also be updated.
|
|
golang:
|
|
docker:
|
|
- image: circleci/golang:1.13
|
|
|
|
jobs:
|
|
test:
|
|
executor: golang
|
|
steps:
|
|
- prometheus/setup_environment
|
|
- run: make
|
|
- prometheus/store_artifact:
|
|
file: cgroup_exporter
|
|
build:
|
|
machine:
|
|
image: ubuntu-1604:201903-01
|
|
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
|
|
publish_master:
|
|
executor: golang
|
|
steps:
|
|
- prometheus/setup_build_environment
|
|
- prometheus/publish_images:
|
|
login_variable: DOCKER_LOGIN
|
|
organization: treydock
|
|
password_variable: DOCKER_PASSWORD
|
|
registry: docker.io
|
|
publish_release:
|
|
executor: golang
|
|
steps:
|
|
- prometheus/setup_build_environment
|
|
- run: promu crossbuild tarballs
|
|
- run: promu checksum .tarballs
|
|
- run: promu release .tarballs
|
|
- store_artifacts:
|
|
destination: releases
|
|
path: .tarballs
|
|
- prometheus/publish_release_images:
|
|
login_variable: DOCKER_LOGIN
|
|
organization: treydock
|
|
password_variable: DOCKER_PASSWORD
|
|
registry: docker.io
|
|
workflows:
|
|
version: 2
|
|
cgroup_exporter:
|
|
jobs:
|
|
- test:
|
|
filters:
|
|
tags:
|
|
only: /.*/
|
|
- build:
|
|
filters:
|
|
tags:
|
|
only: /.*/
|
|
- publish_master:
|
|
context: org-context
|
|
requires:
|
|
- test
|
|
- build
|
|
filters:
|
|
branches:
|
|
only: master
|
|
- publish_release:
|
|
context: org-context
|
|
requires:
|
|
- test
|
|
- build
|
|
filters:
|
|
tags:
|
|
only: /^v([0-9]).*/
|
|
branches:
|
|
ignore: /.*/
|