forked from hltj/kotlin-web-site-cn
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build-devserver.sh
executable file
·60 lines (41 loc) · 1.02 KB
/
build-devserver.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
#!/bin/bash
set -e -u -x
if [ ! -d _assets ]; then
## TODO: make sure asserts are up-to-date...
## Building Frontend part with cache in Docker
echo ""
echo "Building assets..."
echo ""
./build-assets.sh
echo ""
echo "Assets built!"
echo ""
fi
## Running dev server
# build kotlin-web-site container here
docker build --pull -t kotlin-web-site .
## Use the `kotlin-web-site` container name in PyCharm/IntelliJ IDEA to setup python interpreter
if [[ "${1:-}" == "bash" ]]; then
## use 'bash' to debug container internals
docker run -it --rm \
-v $(pwd):/src \
-p 8080:8080 \
--entrypoint bash \
kotlin-web-site
exit $?
fi
while true; do
echo ""
echo "Running Python web server..."
echo ""
docker run -it --rm \
-v $(pwd):/src \
-p 8080:8080 \
kotlin-web-site \
"$@" || true
echo ""
echo "Python exited"
echo "Restarting..."
echo ""
sleep 5
done