-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathdev.sh
executable file
·66 lines (55 loc) · 1.63 KB
/
dev.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
#!/bin/bash
build=true
removeVolumes=false
while getopts ":b|v" option; do
case $option in
b) # display Help
build=false ;;
v)
removeVolumes=true ;;
esac
done
echo ========================== PLUGIN COMPILATION ==================================
cd browser-extension/
npm install
export HOST_ADDR="localhost"
export PROTOCOL="http"
export NODE_ENV="development"
export ELASTIC_PASSWORD="el@st!c"
export TOKEN_SECRET="changeme"
npm run development
cd dist
zip -qr ../chromeExtension ./chrome
cd ..
mv -f chromeExtension.zip ../dashboard/public
cd ..
cd browser-extension/
export PLUGIN_INFO="$(node -e 'console.log(JSON.stringify(require("./src/manifest.chrome.json")))')"
cd ..
rm -rf .logs
mkdir .logs
echo ========================== BROWSER SCRIPT COMPILATION ==================================
cd browser-script/
npm install
npm run development
cd dist
mv -f AIFEXScript.js ../../dashboard/public
cd ../..
echo ========================== CONTAINER DOWN ==================================
if [ $removeVolumes = true ]
then
echo removing volumes
docker-compose -f docker-compose.yml -f docker-compose.development.yml down -v --remove-orphans
else
echo not removing volumes
docker-compose -f docker-compose.yml -f docker-compose.development.yml down --remove-orphans
fi
echo ========================== CONTAINER BUILDING ==================================
if [ $build = true ]
then
echo Building images
docker-compose -f docker-compose.yml -f docker-compose.development.yml up --build
else
echo No Build of images
docker-compose -f docker-compose.yml -f docker-compose.development.yml up
fi