forked from waves-exchange/neutrino-web
-
Notifications
You must be signed in to change notification settings - Fork 0
/
deploy.sh
executable file
·51 lines (43 loc) · 1.05 KB
/
deploy.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
#!/usr/bin/bash
# DEFAULTS
image_name="neutrino"
container_name="neutrino"
build_image () {
docker build -t "$image_name" .
}
run_container () {
docker run -itd --name "$image_name" -p 5001:5001 -p 5000:5000 --env-file .env "$image_name"
}
stop_and_run () {
docker stop "$container_name"
docker rm "$container_name"
run_container
}
simple_deploy () {
# git checkout beta
# git pull origin beta
docker rmi "$image_name"
docker build -t "$image_name" .
docker stop "$image_name"
docker rm "$image_name"
docker run -itd --name "$container_name" -p 5001:5001 -p 5000:5000 --env-file .env "$image_name"
}
simple_build () {
docker build -t "$image_name" .
docker stop "$image_name"
docker rm "$image_name"
}
main () {
while [ -n "$1" ]
do
case "$1" in
--in) image_name=$2 ;;
--cn) container_name=$2 ;;
# --stop-and-run) stop_and_run ;;
--simple-build) simple_build ;;
--simple) simple_deploy ;;
esac
shift
done
}
main $@