-
Notifications
You must be signed in to change notification settings - Fork 1
/
dev
executable file
·50 lines (43 loc) · 1.07 KB
/
dev
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
#!/bin/bash
set -e
IMGNAME=eve/dev
# COLORS
BOLD="\e[1m"
RESET="\e[0m"
function usage {
echo "USAGE $0 [ build | enter ]"
echo ""
echo "COMMANDS"
echo " build: runs docker build command to create ${IMGNAME} image for develop"
echo " build-android: runs docker build command to create ${IMGNAME} image for release on android (slow!)"
echo " enter: runs development environment"
}
function build_docker_image {
echo -e "=> Building ${IMGNAME} ${BOLD}docker image${RESET}"
docker build -t $IMGNAME docker
}
function build_docker_image_android {
echo -e "=> Building ${IMGNAME} ${BOLD}docker image${RESET}"
docker build -t $IMGNAME docker-android
}
function run_development_environment {
docker run -it \
-v `pwd`/src:/home/user/app \
-p 8100:8100 \
-p 35729:35729 \
$IMGNAME
}
case $1 in
build)
build_docker_image
;;
build-android)
build_docker_image_android
;;
enter)
run_development_environment
;;
*)
usage
;;
esac