-
Notifications
You must be signed in to change notification settings - Fork 15
/
build-safescale-local.sh
executable file
·71 lines (49 loc) · 1.24 KB
/
build-safescale-local.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
#! /bin/bash
echo "Checks..."
if [[ ! -v BUILD_ENV ]]; then
echo "BUILD_ENV is not set, this script is intended to run inside a docker container"
[[ $SHLVL -gt 2 ]] && return 1 || exit 1
fi
# ----------------------
# Create working directory
# ----------------------
echo "Accessing working directory"
BRANCH_NAME=${BRANCH_NAME:="develop"}
WRKDIR=${GOPATH=/go}
cd ${WRKDIR}
cd SafeScale
sed -i "s#\(.*\)develop#\1${BRANCH_NAME}#" common.mk
# ----------------------
# Compile
# ----------------------
echo "deps"
make getdevdeps
sleep 4
echo "mod"
make mod
sleep 4
make sdk
sleep 4
make force_sdk_python
sleep 4
make force_sdk_js
sleep 4
make generate
sleep 4
echo "Make All"
make all
[ $? -ne 0 ] && echo "Build failure" && exit 1
echo "Install"
make install
[ $? -ne 0 ] && echo "Install failure" && exit 1
echo "Export"
export CIBIN=/exported
mkdir -p /exported
CIBIN=/exported make installci force_sdk_js force_sdk_python
[ $? -ne 0 ] && echo "Export failure" && exit 1
cp ${WRKDIR}/SafeScale/go.mod /exported
cp ${WRKDIR}/SafeScale/go.sum /exported
cp ${WRKDIR}/SafeScale/lib/protocol/safescale.proto /exported
cp ${WRKDIR}/SafeScale/lib/protocol/javascript/* /exported
cp ${WRKDIR}/SafeScale/lib/protocol/python3/* /exported
exit 0