forked from 2600hz/kazoo
-
Notifications
You must be signed in to change notification settings - Fork 0
/
config.yml
254 lines (250 loc) · 7.4 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
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
version: 2
workflows:
version: 2
build_branch:
jobs:
- setup
- build_deps:
requires:
- setup
- build:
requires:
- build_deps
- eunit_tests:
requires:
- build_deps
- checks:
requires:
- build
- docs:
requires:
- build
- analyze:
requires:
- build
- release:
requires:
- build
defaults: &defaults
docker:
- image: offical2600hz/circleci:22.3
working_directory: ~/2600hz/kazoo
shell: /bin/bash --login
environment:
BASH_ENV: ".git/.bashrc"
jobs:
setup:
<<: *defaults
steps:
- checkout
- run:
name: Listing Changes
command: make changed
- persist_to_workspace:
root: .
paths:
- .
build_deps:
<<: *defaults
steps:
- attach_workspace:
at: .
- restore_cache:
keys:
- deps-v1-{{ checksum "make/deps.mk" }}-{{ checksum "/usr/local/lib/erlang/releases/RELEASES" }}
- run:
name: Calculating dependency hash for CircleCI cache
command: |
deps_hash=$(md5sum make/deps.mk | cut -d" " -f1)
if [ x"$(cat .git/.kz_deps_hash)" = x"$deps_hash" ]; then
touch "make/.deps.mk.$deps_hash"
fi
(echo -n $(md5sum $KAZOO_ROOT/make/deps.mk | cut -d" " -f1) | tee "$KAZOO_ROOT/.git/.kz_deps_hash") && echo
md5sum make/deps.mk
ls -al make
- run:
name: Making dependencies
command : make deps
- save_cache:
key: deps-v1-{{ checksum "make/deps.mk" }}-{{ checksum "/usr/local/lib/erlang/releases/RELEASES" }}
paths:
- deps/
- .git/.kz_deps_hash
- persist_to_workspace:
root: .
paths:
- .
build:
<<: *defaults
steps:
- attach_workspace:
at: .
- restore_cache:
keys:
- deps-v1-{{ checksum "make/deps.mk" }}-{{ checksum "/usr/local/lib/erlang/releases/RELEASES" }}
- run:
name: Compiling the project
command: JOBS="2" make
- persist_to_workspace:
root: .
paths:
- .
eunit_tests:
<<: *defaults
steps:
- attach_workspace:
at: .
- restore_cache:
keys:
- deps-v1-{{ checksum "make/deps.mk" }}-{{ checksum "/usr/local/lib/erlang/releases/RELEASES" }}
- run:
name: Compiling for unit test enviornment
command: ERLC_OPTS='-DPROPER' make compile-test
- run:
name: Running Eunit/Proper tests
command: make eunit
- run:
name: Save test results
command: |
mkdir -p ~/test-results/junit/
find . -type f -name "TEST-*.xml" -exec cp {} ~/test-results/junit/ \;
when: always
- store_test_results:
path: ~/test-results
- store_artifacts:
path: ~/test-results/junit/
## disabling this for now until we figure out why it is crashing, and how to set token
# - run:
# name: Uploading Coverage Report
# command: make coverage-report
checks:
<<: *defaults
steps:
- attach_workspace:
at: .
- run:
name: Running code formatter
command: make fmt
- run:
name: Running code checks
command: make code_checks
- run:
name: Checking app source file
command: make app_applications
- run:
name: Generating sup bash completion files
command: make sup_completion
- run:
name: Running xref check
command: make xref
- run:
name: Running Elvis code style check
command: make elvis
- run:
name: Checking for unstaged files
command: scripts/check-unstaged.bash
docs:
<<: *defaults
steps:
- attach_workspace:
at: .
- run:
name: Generating APIs
command: make apis
- run:
name: Validating CouchDB view files
command: make validate-js
- run:
name: Validating schemas
command: make validate-schemas
- run:
name: Generating docs
command: make docs
- run:
name: Checking doc states
command: scripts/state-of-docs.py || true
- run:
name: Validating EDoc states
command: scripts/state-of-edoc.escript
- run:
name: Checking for unstaged files
command: scripts/check-unstaged.bash
analyze:
<<: *defaults
steps:
- attach_workspace:
at: .
- restore_cache:
keys:
- plt-v1-{{ checksum "~/2600hz/kazoo/make/deps.mk" }}-{{ checksum "/usr/local/lib/erlang/releases/RELEASES" }}
- run:
name: Building plt file
command: make build-plt
- run:
name: Dialyzing changed Erlang files
command: make dialyze-changed
- save_cache:
key: plt-v1-{{ checksum "make/deps.mk" }}-{{ checksum "/usr/local/lib/erlang/releases/RELEASES" }}
paths:
- .kazoo.plt
release:
<<: *defaults
docker:
- image: offical2600hz/circleci:22.3
- image: couchdb:3.0
environment:
COUCHDB_USER: admin
COUCHDB_PASSWORD: admin
- image: 2600hz/rabbitmq
environment:
CIRCLE_ARTIFACTS: /tmp/circleci-artifacts
TZ: "/usr/share/zoneinfo/UTC"
steps:
- attach_workspace:
at: .
- run:
name: Creating artifacts directory
command: mkdir -p $CIRCLE_ARTIFACTS
- run:
name: Building CI release
command: make build-ci-release
- run:
name: Running Kazoo release
command: KAZOO_CONFIG=${PWD}/rel/ci.config.ini REL="kazoo_apps" ACT="console" NODE_NAME_TYPE="-sname" make release
- run:
name: Copying Relx config artifacts
command: cp ${PWD}/rel/ci.relx.config $CIRCLE_ARTIFACTS/
- run:
name: Copying release Artifacts
command: find ${PWD}/_rel/kazoo/releases -name kazoo.rel -exec cp {} $CIRCLE_ARTIFACTS/ \;
- store_artifacts:
path: /tmp/circleci-artifacts
- run:
name: Checking for errors in artifacts
command: |
if [[ $(grep -c -v -F 'exit with reason shutdown' ${CIRCLE_ARTIFACTS}/log/error.log) -gt 0 ]]; then
printf ":: some errors are detected during running release\n\n"
cat ${CIRCLE_ARTIFACTS}/log/error.log
exit 1
else
printf ":: no errors are found in release\n\n"
fi
build_centos7:
docker:
- image: offical2600hz/kazoo-packager-22:1.0-centos-7
user: circleci
shell: /bin/bash --login
working_directory: /home/circleci/2600hz/kazoo
environment:
CIRCLE_ARTIFACTS: /tmp/circleci-artifacts
CIRCLE_TEST_REPORTS: /tmp/circleci-test-results
BASH_ENV: "/home/circleci/2600hz/.bashrc"
BUILD_ROOT: "/home/circleci/2600hz/packager"
KAZOO_ROOT: "/home/circleci/2600hz/kazoo"
BUILD_SOURCES: "/home/circleci/2600hz/packager/SOURCES"
BUILD_RPMS: "/home/circleci/2600hz/packager/RPMS"
APP_DIR: "/home/circleci/2600hz/kazoo"
steps:
- run:
name: dummy step
command: echo ok