2021-02-19 09:52:01 +00:00
|
|
|
---
|
|
|
|
version: 2.1
|
|
|
|
|
|
|
|
orbs:
|
2022-05-25 09:27:42 +00:00
|
|
|
prometheus: prometheus/prometheus@0.16.0
|
2021-02-19 09:52:01 +00:00
|
|
|
|
|
|
|
executors:
|
|
|
|
# This must match .promu.yml.
|
|
|
|
golang:
|
|
|
|
docker:
|
2022-05-25 09:27:42 +00:00
|
|
|
- image: cimg/go:1.18
|
2021-02-19 09:52:01 +00:00
|
|
|
|
|
|
|
jobs:
|
|
|
|
test:
|
|
|
|
executor: golang
|
|
|
|
|
|
|
|
steps:
|
|
|
|
- prometheus/setup_environment
|
|
|
|
- run: make
|
|
|
|
- prometheus/store_artifact:
|
|
|
|
file: postgres_exporter
|
|
|
|
|
2021-02-27 14:53:14 +00:00
|
|
|
integration:
|
|
|
|
docker:
|
2022-05-25 09:27:42 +00:00
|
|
|
- image: cimg/go:1.18
|
2021-02-27 14:53:14 +00:00
|
|
|
- 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
|
|
|
|
|
2021-02-19 09:52:01 +00:00
|
|
|
workflows:
|
|
|
|
version: 2
|
|
|
|
postgres_exporter:
|
|
|
|
jobs:
|
|
|
|
- test:
|
|
|
|
filters:
|
|
|
|
tags:
|
|
|
|
only: /.*/
|
2021-02-27 14:53:14 +00:00
|
|
|
- integration:
|
|
|
|
matrix:
|
|
|
|
parameters:
|
|
|
|
postgres_image:
|
|
|
|
- circleci/postgres:10
|
|
|
|
- circleci/postgres:11
|
|
|
|
- circleci/postgres:12
|
|
|
|
- circleci/postgres:13
|
2022-01-14 16:22:03 +00:00
|
|
|
- cimg/postgres:14.1
|
2021-02-19 09:52:01 +00:00
|
|
|
- prometheus/build:
|
|
|
|
name: build
|
2022-07-28 11:42:32 +00:00
|
|
|
parallelism: 3
|
|
|
|
promu_opts: "-p linux/amd64 -p windows/amd64 -p linux/arm64 -p darwin/amd64 -p darwin/arm64 -p linux/386"
|
2021-02-19 09:52:01 +00:00
|
|
|
filters:
|
|
|
|
tags:
|
2022-07-28 11:42:32 +00:00
|
|
|
ignore: /^v.*/
|
|
|
|
branches:
|
|
|
|
ignore: /^(main|master|release-.*|.*build-all.*)$/
|
|
|
|
- prometheus/build:
|
|
|
|
name: build_all
|
|
|
|
parallelism: 12
|
|
|
|
filters:
|
|
|
|
branches:
|
|
|
|
only: /^(main|master|release-.*|.*build-all.*)$/
|
|
|
|
tags:
|
|
|
|
only: /^v.*/
|
2021-02-19 09:52:01 +00:00
|
|
|
- prometheus/publish_master:
|
|
|
|
context: org-context
|
|
|
|
docker_hub_organization: prometheuscommunity
|
|
|
|
quay_io_organization: prometheuscommunity
|
|
|
|
requires:
|
|
|
|
- test
|
2022-07-28 11:42:32 +00:00
|
|
|
- build_all
|
2021-02-19 09:52:01 +00:00
|
|
|
filters:
|
|
|
|
branches:
|
|
|
|
only: master
|
|
|
|
- prometheus/publish_release:
|
|
|
|
context: org-context
|
|
|
|
docker_hub_organization: prometheuscommunity
|
|
|
|
quay_io_organization: prometheuscommunity
|
|
|
|
requires:
|
|
|
|
- test
|
2022-07-28 11:42:32 +00:00
|
|
|
- build_all
|
2021-02-19 09:52:01 +00:00
|
|
|
filters:
|
|
|
|
tags:
|
|
|
|
only: /^v.*/
|
|
|
|
branches:
|
|
|
|
ignore: /.*/
|