-
Notifications
You must be signed in to change notification settings - Fork 25
/
build.sh
executable file
·85 lines (77 loc) · 1.41 KB
/
build.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
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
#!/bin/bash
#cd `dirname $0`
#cd ..
DIRS=("airline"
"approval-chain"
"auction"
"broadcast"
"chat"
"chess"
"crowd-funding"
"expense-pool"
"governance"
"issuertoken"
"onboarding"
"option"
"shop"
"task-tracking"
"tic-tac-toe"
"voting"
)
function cleanDars {
for dr in ${DIRS[@]}
do
rm -f $dr/.dist
done
}
function buildDars {
for dr in ${DIRS[@]}
do
echo "Building dar in $dr"
cd $dr
daml build
cd ..
done
}
function testDars {
for dr in ${DIRS[@]}
do
echo "Testing dar in $dr"
cd $dr
daml test
cd ..
done
}
function updateVersion {
if [ "$1" == "" ]; then
echo "please provide the new version"
exit 1
fi
for dr in ${DIRS[@]}
do
cat $dr/daml.yaml | sed -E "s/^(sdk-version:).*/\\1 $1/" > tmp.yml
mv tmp.yml $dr/daml.yaml
done
cat daml.yaml | sed -E "s/^(sdk-version:).*/\\1 $1/" > tmp.yml
mv tmp.yml daml.yaml
cat ./.circleci/config.yml | sed -E "s/daml-sdk:.*/daml-sdk:$1/" > tmp.yml
mv tmp.yml ./.circleci/config.yml
}
case $1 in
update-version)
updateVersion $2
;;
build-dars)
cleanDars
buildDars
;;
test-dars)
testDars
;;
*)
echo "builder <command>"
echo " commands are:"
echo " build-dars - builds the dars"
echo " update-version <version> - changes the sdk version number"
;;
esac