2018-05-03 07:36:23 +00:00
|
|
|
---
|
2018-10-10 06:59:17 +00:00
|
|
|
version: 2.1
|
2019-06-24 13:17:24 +00:00
|
|
|
orbs:
|
2023-03-13 16:42:18 +00:00
|
|
|
prometheus: prometheus/prometheus@0.17.1
|
2024-08-12 08:31:33 +00:00
|
|
|
go: circleci/go@1.11.0
|
2019-03-13 10:12:01 +00:00
|
|
|
jobs:
|
2019-08-26 09:15:28 +00:00
|
|
|
test_frontend:
|
|
|
|
# We need to use a machine executor because the front-end validation runs
|
|
|
|
# containers with mounted volumes which isn't supported with the docker
|
|
|
|
# executor (even with setup_remote_docker).
|
2022-05-04 11:55:49 +00:00
|
|
|
machine:
|
2022-07-23 14:56:26 +00:00
|
|
|
image: ubuntu-2204:current
|
2019-08-26 09:15:28 +00:00
|
|
|
steps:
|
2021-12-22 13:03:53 +00:00
|
|
|
- checkout
|
|
|
|
- run: sudo service docker restart
|
|
|
|
- run:
|
|
|
|
name: Remove existing Go installation
|
|
|
|
command: sudo rm -rf /usr/local/go
|
|
|
|
# Whenever the Go version is updated here, .promu.yml should also be updated.
|
|
|
|
- go/install:
|
2024-08-12 08:31:33 +00:00
|
|
|
version: "1.22.6"
|
2021-12-22 13:03:53 +00:00
|
|
|
- run:
|
|
|
|
name: Remove generated code
|
|
|
|
command: make clean
|
|
|
|
- run:
|
|
|
|
name: Generate front-end code
|
|
|
|
command: make all
|
|
|
|
working_directory: ~/project/ui/app
|
|
|
|
environment:
|
|
|
|
JUNIT_DIR: ~/test-results
|
|
|
|
- run:
|
|
|
|
name: Generate assets
|
|
|
|
command: make assets
|
|
|
|
- run:
|
|
|
|
name: Generate API v2 code
|
|
|
|
command: make apiv2
|
|
|
|
- run: git diff --exit-code
|
|
|
|
- store_test_results:
|
|
|
|
path: ~/test-results
|
2022-04-22 10:07:11 +00:00
|
|
|
- run:
|
|
|
|
name: Save assets
|
|
|
|
command: make assets-tarball
|
|
|
|
- persist_to_workspace:
|
|
|
|
root: .
|
|
|
|
paths:
|
|
|
|
- .tarballs
|
2019-03-13 10:12:01 +00:00
|
|
|
test:
|
2018-05-03 07:36:23 +00:00
|
|
|
docker:
|
2021-12-22 13:03:53 +00:00
|
|
|
# Whenever the Go version is updated here, .promu.yml should also be updated.
|
2024-08-12 08:31:33 +00:00
|
|
|
- image: quay.io/prometheus/golang-builder:1.22-base
|
2021-12-22 13:03:53 +00:00
|
|
|
# maildev containers are for running the email tests against a "real" SMTP server.
|
|
|
|
# See notify/email_test.go for details.
|
2024-08-12 08:31:33 +00:00
|
|
|
- image: maildev/maildev:2.1.0
|
2021-12-22 13:03:53 +00:00
|
|
|
name: maildev-noauth
|
|
|
|
entrypoint: bin/maildev
|
|
|
|
command:
|
|
|
|
- -v
|
2024-08-12 08:31:33 +00:00
|
|
|
- image: maildev/maildev:2.1.0
|
2021-12-22 13:03:53 +00:00
|
|
|
name: maildev-auth
|
|
|
|
entrypoint: bin/maildev
|
|
|
|
command:
|
|
|
|
- -v
|
|
|
|
- --incoming-user
|
|
|
|
- user
|
|
|
|
- --incoming-pass
|
|
|
|
- pass
|
2019-03-13 10:12:01 +00:00
|
|
|
environment:
|
|
|
|
EMAIL_NO_AUTH_CONFIG: /tmp/smtp_no_auth.yml
|
|
|
|
EMAIL_AUTH_CONFIG: /tmp/smtp_auth.yml
|
2018-05-03 07:36:23 +00:00
|
|
|
steps:
|
2021-12-22 13:03:53 +00:00
|
|
|
- prometheus/setup_environment
|
|
|
|
- go/load-cache:
|
|
|
|
key: v1-go-mod
|
|
|
|
- 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:
|
|
|
|
version: "3.15.8"
|
|
|
|
- prometheus/store_artifact:
|
|
|
|
file: alertmanager
|
|
|
|
- prometheus/store_artifact:
|
|
|
|
file: amtool
|
|
|
|
- go/save-cache:
|
|
|
|
key: v1-go-mod
|
|
|
|
- store_test_results:
|
|
|
|
path: test-results
|
2020-12-03 14:57:42 +00:00
|
|
|
mixin:
|
|
|
|
docker:
|
2021-12-22 13:03:53 +00:00
|
|
|
# Whenever the Go version is updated here, .promu.yml should also be updated.
|
2024-08-12 08:31:33 +00:00
|
|
|
- image: quay.io/prometheus/golang-builder:1.22-base
|
2020-12-03 14:57:42 +00:00
|
|
|
steps:
|
2021-12-22 13:03:53 +00:00
|
|
|
- checkout
|
2023-08-03 13:00:32 +00:00
|
|
|
# pin the mixtool version until https://github.com/monitoring-mixins/mixtool/issues/135 is merged.
|
|
|
|
- run: go install github.com/monitoring-mixins/mixtool/cmd/mixtool@2282201396b69055bb0f92f187049027a16d2130
|
2022-07-23 14:56:26 +00:00
|
|
|
- run: go install github.com/google/go-jsonnet/cmd/jsonnetfmt@latest
|
|
|
|
- run: go install github.com/jsonnet-bundler/jsonnet-bundler/cmd/jb@latest
|
|
|
|
- run: make -C doc/alertmanager-mixin lint
|
2018-05-03 07:36:23 +00:00
|
|
|
workflows:
|
|
|
|
version: 2
|
|
|
|
alertmanager:
|
|
|
|
jobs:
|
2021-12-22 13:03:53 +00:00
|
|
|
- test_frontend:
|
|
|
|
filters:
|
|
|
|
tags:
|
|
|
|
only: /.*/
|
|
|
|
- test:
|
|
|
|
filters:
|
|
|
|
tags:
|
|
|
|
only: /.*/
|
|
|
|
- prometheus/build:
|
|
|
|
name: build
|
2022-07-25 15:42:10 +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-12-22 13:03:53 +00:00
|
|
|
filters:
|
|
|
|
tags:
|
2022-07-25 15:42:10 +00:00
|
|
|
ignore: /^v2(\.[0-9]+){2}(-.+|[^-.]*)$/
|
|
|
|
branches:
|
|
|
|
ignore: /^(main|release-.*|.*build-all.*)$/
|
|
|
|
- prometheus/build:
|
|
|
|
name: build_all
|
|
|
|
parallelism: 12
|
|
|
|
filters:
|
|
|
|
branches:
|
|
|
|
only: /^(main|release-.*|.*build-all.*)$/
|
|
|
|
tags:
|
2022-12-16 20:53:05 +00:00
|
|
|
only: /^v[0-9]+(\.[0-9]+){2}(-.+|[^-.]*)$/
|
2021-12-22 13:03:53 +00:00
|
|
|
- mixin:
|
|
|
|
filters:
|
|
|
|
tags:
|
|
|
|
only: /.*/
|
|
|
|
- prometheus/publish_main:
|
|
|
|
context: org-context
|
|
|
|
requires:
|
|
|
|
- test_frontend
|
|
|
|
- test
|
2022-07-25 15:42:10 +00:00
|
|
|
- build_all
|
2021-12-22 13:03:53 +00:00
|
|
|
filters:
|
|
|
|
branches:
|
|
|
|
only: main
|
|
|
|
- prometheus/publish_release:
|
|
|
|
context: org-context
|
|
|
|
requires:
|
|
|
|
- test_frontend
|
|
|
|
- test
|
2022-07-25 15:42:10 +00:00
|
|
|
- build_all
|
2021-12-22 13:03:53 +00:00
|
|
|
filters:
|
|
|
|
tags:
|
|
|
|
only: /^v[0-9]+(\.[0-9]+){2}(-.+|[^-.]*)$/
|
|
|
|
branches:
|
|
|
|
ignore: /.*/
|