postgres_exporter/.circleci/config.yml

91 lines
1.9 KiB
YAML

---
version: 2.1
orbs:
prometheus: prometheus/prometheus@0.16.0
executors:
# This must match .promu.yml.
golang:
docker:
- image: cimg/go:1.18
jobs:
test:
executor: golang
steps:
- prometheus/setup_environment
- run: make
- prometheus/store_artifact:
file: postgres_exporter
integration:
docker:
- image: cimg/go:1.18
- image: << parameters.postgres_image >>
environment:
POSTGRES_DB: circle_test
POSTGRES_USER: postgres
POSTGRES_PASSWORD: test
parameters:
postgres_image:
type: string
environment:
DATA_SOURCE_NAME: 'postgresql://postgres:test@localhost:5432/circle_test?sslmode=disable'
GOOPTS: '-v -tags integration'
steps:
- checkout
- setup_remote_docker
- run: docker version
- run: make build
- run: make test
workflows:
version: 2
postgres_exporter:
jobs:
- test:
filters:
tags:
only: /.*/
- integration:
matrix:
parameters:
postgres_image:
- circleci/postgres:10
- circleci/postgres:11
- circleci/postgres:12
- circleci/postgres:13
- cimg/postgres:14.1
- prometheus/build:
name: build
filters:
tags:
only: /.*/
- prometheus/publish_master:
context: org-context
docker_hub_organization: prometheuscommunity
quay_io_organization: prometheuscommunity
requires:
- test
- build
filters:
branches:
only: master
- prometheus/publish_release:
context: org-context
docker_hub_organization: prometheuscommunity
quay_io_organization: prometheuscommunity
requires:
- test
- build
filters:
tags:
only: /^v.*/
branches:
ignore: /.*/