-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathbuild.sh
69 lines (56 loc) · 1.12 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
doTest () {
if [ "$test" = 'Y' ];then
echo " running tests..."
go test ./...
fi
}
test="N"
while getopts "t" OPTION; do
case "$OPTION" in
t)
echo "Build and test requested."
test="Y"
;;
esac
done
echo "Policy Mapper installation"
echo " building..."
go build ./...
doTest
echo " installing..."
go install ./...
printf "Start Hexa CLI by using the 'hexa' command.\nIf the command is not found, check that the go/bin directory is in your PATH.\n"
exit
# This section is for when policy-models is multi-module - not currently used
echo "Building 5 sub-modules in workspace..."
# go work sync
echo " pkg "
cd ./pkg
go build ./...
doTest
cd ..
echo " mapper/conditionLangs/gcpcel."
cd models/conditionLangs/gcpcel
go build ./...
doTest
cd ../../..
echo " mapper/formats/awsCedar."
cd models/formats/awsCedar
go build ./...
doTest
cd ../../..
echo " mapper/formats/gcpBind."
cd models/formats/gcpBind
go build ./...
doTest
cd ../../..
echo " providers/aws."
cd providers/aws
go build ./...
doTest
cd ../..
echo " mapTool."
cd cmd/mapTool
go build -o ../../mapTool main.go
doTest
cd ../../