-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild-eventcatalog.sh
54 lines (45 loc) · 1.09 KB
/
build-eventcatalog.sh
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
#!/bin/bash
set -o pipefail
# Orchestrate the functionality
main() {
clean
configBuild
npx eventcatalog generate
configRun
configCore
npx eventcatalog build
}
# Erase any garbage and previous output and configurations
clean() {
find . -name '.DS_Store' -type f -delete
rm -rf domains && rm -rf events && rm -rf services
cleanConfig
}
# Erase root-level configuration
cleanConfig() {
rm -f eventcatalog.config.js
}
# Write configuration contents to start of EventCatalog config
configUpdate() {
cat configs/baseconfig.js | cat - eventcatalog.config.js >temp && mv temp eventcatalog.config.js
}
# Use the "build" configuration
configBuild() {
cleanConfig
cp configs/eventcatalog.config.build.js eventcatalog.config.js
configUpdate
}
# Use the regular "run" configuration
configRun() {
cleanConfig
touch eventcatalog.config.js
configUpdate
}
# Update the EventCatalog "core" configuration with our "run" configuration
configCore() {
rm -f .eventcatalog-core/eventcatalog.config.js
cp configs/baseconfig.js .eventcatalog-core/eventcatalog.config.js
}
# Start
main
exit