alertmanager/.circleci/config.yml

93 lines
2.4 KiB
YAML

---
version: 2.1
orbs:
prometheus: prometheus/prometheus@0.1.0
jobs:
test:
docker:
# Whenever the Go version is updated here, .travis.yml and .promu.yml
# should also be updated.
- image: circleci/golang:1.12
# maildev containers are for running the email tests against a "real" SMTP server.
# See notify/email_test.go for details.
- image: djfarrelly/maildev@sha256:624e0ec781e11c3531da83d9448f5861f258ee008c1b2da63b3248bfd680acfa
name: maildev-noauth
entrypoint: bin/maildev
command:
- -v
- image: djfarrelly/maildev@sha256:624e0ec781e11c3531da83d9448f5861f258ee008c1b2da63b3248bfd680acfa
name: maildev-auth
entrypoint: bin/maildev
command:
- -v
- --incoming-user
- user
- --incoming-pass
- pass
environment:
EMAIL_NO_AUTH_CONFIG: /tmp/smtp_no_auth.yml
EMAIL_AUTH_CONFIG: /tmp/smtp_auth.yml
steps:
- prometheus/setup_environment
- run:
command: |
cat \<<EOF > $EMAIL_NO_AUTH_CONFIG
smarthost: maildev-noauth:1025
server: http://maildev-noauth:1080/
EOF
cat \<<EOF > $EMAIL_AUTH_CONFIG
smarthost: maildev-auth:1025
server: http://maildev-auth:1080/
username: user
password: pass
EOF
- run:
command: make
environment:
# By default Go uses GOMAXPROCS but a Circle CI executor has many
# cores (> 30) while the CPU and RAM resources are throttled. If we
# don't limit this to the number of allocated cores, the job is
# likely to get OOMed and killed.
GOOPTS: "-p 2"
- prometheus/check_proto
- prometheus/store_artifact:
file: alertmanager
- prometheus/store_artifact:
file: amtool
workflows:
version: 2
alertmanager:
jobs:
- test:
filters:
tags:
only: /.*/
- prometheus/build:
name: build
filters:
tags:
only: /.*/
- prometheus/publish_master:
context: org-context
requires:
- test
- build
filters:
branches:
only: master
- prometheus/publish_release:
context: org-context
requires:
- test
- build
filters:
tags:
only: /^v[0-9]+(\.[0-9]+){2}(-.+|[^-.]*)$/
branches:
ignore: /.*/