-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.sh
executable file
·49 lines (46 loc) · 1.47 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
#!/usr/bin/env bash
set -e
if [[ "$OUT" == "" ]]; then
OUT=${PWD}/result
fi
function build_c_reference_signer {
mkdir -p ${OUT}/bin
rm -Rf ${OUT}/c-reference-signer ${OUT}/headers ${OUT}/libmina_signer.so # Otherwise re-building without clean causes permissions issue
if [[ "$PKG_MINA_SIGNER" == "" ]]; then
# No nix
git clone -b v1.0.0 --depth 1 https://github.com/MinaProtocol/c-reference-signer.git ${OUT}/c-reference-signer
cp -f ./Makefile-c-ref-signer ${OUT}/c-reference-signer/Makefile
make -C ${OUT}/c-reference-signer clean libmina_signer.so
cp ${OUT}/c-reference-signer/libmina_signer.so ${OUT}
mkdir -p ${OUT}/headers
cp ${OUT}/c-reference-signer/*.h ${OUT}/headers
else
ln -s ${PKG_MINA_SIGNER}/lib/libmina_signer.so ${OUT}/libmina_signer.so
ln -s ${PKG_MINA_SIGNER}/headers ${OUT}/headers
fi
}
case "${1}" in
test)
build_c_reference_signer
cd src/uptime_backend
LD_LIBRARY_PATH=${OUT} ${GO} test
cd ../..
;;
docker-publish)
DOCKER_IMAGE_TAG=in-memory-uptime-backend
docker build -t ${DOCKER_IMAGE_TAG} .
docker tag ${DOCKER_IMAGE_TAG} o1labs/mina-perf-testing:${DOCKER_IMAGE_TAG}
docker push o1labs/mina-perf-testing:${DOCKER_IMAGE_TAG}
;;
"")
build_c_reference_signer
cd src/cmd/uptime_backend
${GO} build -o ${OUT}/bin/uptime_backend
echo ""
echo "To run the application please use the following command: LD_LIBRARY_PATH=result ./result/bin/uptime_backend"
;;
*)
echo "Unknown command ${1}"
exit 2
;;
esac