forked from ppenalver/egeo
-
Notifications
You must be signed in to change notification settings - Fork 0
/
startup.sh
executable file
·38 lines (30 loc) · 869 Bytes
/
startup.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
#!/usr/bin/env bash
set -u -e -o pipefail
set +x
while true; do
read -p "Do you want to download the latest of repo? (CAUTION!!! This erase any local change) [y/n] " yn
case $yn in
[Yy]* ) git checkout -- . && git clean -fd && git pull; break;;
[Nn]* ) echo "continue"; break;;
* ) echo "Please answer yes or no.";;
esac
done
while true; do
read -p "Do you want to reinstall packages? [y/n] " yn
case $yn in
[Yy]* ) npm i; break;;
[Nn]* ) echo "continue"; break;;
* ) echo "Please answer yes or no.";;
esac
done
# Generate package
npm run build:demo-app
# Remove old image if exists
IMG_ID=`docker ps -aq --filter "ancestor=egeo-demos"`
if [[ $IMG_ID ]]; then
docker rm -f $IMG_ID
fi
# Generate docker and run
docker build -t egeo-demos .
docker run -p 9502:9502 -itd egeo-demos
set -x