-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbuild.sh
More file actions
49 lines (44 loc) · 1.08 KB
/
build.sh
File metadata and controls
49 lines (44 loc) · 1.08 KB
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
#!/usr/bin/env bash
export TAG=monolith
# Update submodules
if git submodule update --init; then
echo All submodules have been updated
else
echo Cannot update submodules
exit 1
fi
# Backend submodules
declare -a repos=(
"chain-adapter"
"d3-btc"
#TODO add Ethereum later
#"d3-eth"
"notary"
"report-system"
"business-rules"
)
readonly var backoffice="back-office"
# Update frontend
if git -C $backoffice checkout develop --force && git -C $backoffice pull origin develop --rebase; then
echo Frontend repo has been updated successfully
else
echo Cannot update frontend repo
exit 1
fi
# Build frontend
if yarn --cwd $backoffice; then
echo Frontend has been built successfully
else
echo Cannot build frontend
exit 1
fi
# Build backend
for repo in "${repos[@]}"; do
# Checkout to develop, pull and build docker images
if git -C $repo checkout develop --force && git -C $repo pull origin develop --rebase && $repo/gradlew -p $repo clean dockerBuild; then
echo All projects have been built successfully
else
echo Cannot build project $repo
exit 1
fi
done