-
Notifications
You must be signed in to change notification settings - Fork 2.1k
/
config.yml
168 lines (168 loc) · 5.1 KB
/
config.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
---
version: 2.1
orbs:
prometheus: prometheus/prometheus@0.16.0
go: circleci/go@1.7.0
jobs:
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).
machine:
image: ubuntu-2204:current
steps:
- 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:
version: "1.19"
- 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
- run:
name: Save assets
command: make assets-tarball
- persist_to_workspace:
root: .
paths:
- .tarballs
test:
docker:
# Whenever the Go version is updated here, .promu.yml should also be updated.
- image: quay.io/prometheus/golang-builder:1.19-base
# maildev containers are for running the email tests against a "real" SMTP server.
# See notify/email_test.go for details.
- image: maildev/maildev:1.1.0
name: maildev-noauth
entrypoint: bin/maildev
command:
- -v
- image: maildev/maildev:1.1.0
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
- 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
mixin:
docker:
# Whenever the Go version is updated here, .promu.yml should also be updated.
- image: quay.io/prometheus/golang-builder:1.19-base
steps:
- checkout
- run: go install github.com/monitoring-mixins/mixtool/cmd/mixtool@latest
- 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
workflows:
version: 2
alertmanager:
jobs:
- test_frontend:
filters:
tags:
only: /.*/
- test:
filters:
tags:
only: /.*/
- prometheus/build:
name: build
parallelism: 3
promu_opts: "-p linux/amd64 -p windows/amd64 -p linux/arm64 -p darwin/amd64 -p darwin/arm64 -p linux/386"
filters:
tags:
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:
only: /^v[0-9]+(\.[0-9]+){2}(-.+|[^-.]*)$/
- mixin:
filters:
tags:
only: /.*/
- prometheus/publish_main:
context: org-context
requires:
- test_frontend
- test
- build_all
docker_version: "20.10.18"
filters:
branches:
only: main
- prometheus/publish_release:
context: org-context
requires:
- test_frontend
- test
- build_all
docker_version: "20.10.18"
filters:
tags:
only: /^v[0-9]+(\.[0-9]+){2}(-.+|[^-.]*)$/
branches:
ignore: /.*/