-
-
Notifications
You must be signed in to change notification settings - Fork 42
/
buildinstall.sh
executable file
·46 lines (38 loc) · 1.06 KB
/
buildinstall.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
#!/bin/bash
sudo apt-get update -y
sudo apt-get upgrade -y
sudo apt-get install g++ -y
sudo apt-get install libz-dev -y
make clean
if [ -f "Makefile" ]; then
echo "STATUS- Found Makefile- building application"
make -j8
else
echo "STATUS- Unable to find Makefile- aborting!!!"
exit
fi
if [ -f "fillet" ]; then
echo "STATUS- fillet application was successfully built!"
else
echo "STATUS- fillet application was not successfully build! aborting!!!"
exit
fi
cp fillet ./docker
pushd ./docker
echo "STATUS- building Docker container image"
sudo docker build -t dockerfillet .
popd
pushd /var/app
sudo pm2 start server.js
popd
sudo pm2 status server
# check if server.js service started or not?
echo "STATUS- testing NodeJS API"
curl http://127.0.0.1:8080/api/v1/system_information
curl http://127.0.0.1:8080/api/v1/get_service_count
curl http://127.0.0.1:8080/api/v1/get_interfaces
curl http://127.0.0.1:8080/api/v1/get_service_status/0
echo "STATUS- adding pm2 to systemd"
sudo pm2 startup systemd
echo "STATUS- saving the active services"
sudo pm2 save