-
Notifications
You must be signed in to change notification settings - Fork 68
Expand file tree
/
Copy pathdev_env.sh
More file actions
executable file
·61 lines (49 loc) · 903 Bytes
/
dev_env.sh
File metadata and controls
executable file
·61 lines (49 loc) · 903 Bytes
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
#/bin/bash
set -xe
container_name=dev-hivemind-env
run() {
tag=$1
network=$2
if [ "${tag}" = "" ]; then
tag=dev-env
fi
if [ "${network}" = "" ]; then
network=bridge
fi
docker run -itd --rm \
--name ${container_name} \
-v $(pwd):/project \
--env-file $(pwd)/.env \
--workdir /project \
--network ${network} \
steemit/hivemind:${tag} \
/bin/bash
}
cli() {
docker exec -it ${container_name} /bin/bash
}
stop() {
docker stop ${container_name}
}
main_func() {
op=$1
tag=$2
network=$3
case ${op} in
run)
run $tag $network
cli
;;
cli)
cli
;;
stop)
stop
;;
*)
echo "Unknown Command"
exit 1
;;
esac
}
main_func $1 $2 $3