-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathjust
executable file
·71 lines (61 loc) · 1.54 KB
/
just
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
61
62
63
64
65
66
67
68
69
70
71
#!/bin/bash
YELLOW='\033[1;33m'
RED='\033[1;31m'
CYAN='\033[0;36m'
NOCOL='\033[0m'
UNDERLINE='\033[4m'
NOUNDERLINE='\033[24m'
set -e
build() {
docker build -t loreanvictor/connect-platform .
}
run() {
kill
if [ -z "$1" ]; then
docker run -dit \
--name connect-platform \
-p 4000:4000 \
-v $(pwd)/panel-generated:/app/panel-generated \
-v $(pwd)/secure:/app/secure \
--env CONNECT_INSTALL_EXTERNAL_PACKAGES=true \
loreanvictor/connect-platform
else
docker run -dit \
--name connect-platform \
-p 4000:4000 \
-v $(pwd)/panel-generated:/app/panel-generated \
-v $(pwd)/secure:/app/secure \
--env CONNECT_INSTALL_EXTERNAL_PACKAGES=true \
--env CONNECT_PANEL_SECRET=$1 \
loreanvictor/connect-platform
fi
echo -e "${CYAN}server operational.${NOCOL}"
echo -e "${UNDERLINE}localhost:4000/panel/${NOUNDERLINE}"
}
kill() {
set +e
docker kill connect-platform
docker rm connect-platform
set -e
}
shell() {
docker exec -it connect-platform bash
}
logs() {
docker logs connect-platform
}
clean() {
kill
docker rmi loreanvictor/connect-platform -f
}
push() {
build
docker push loreanvictor/connect-platform
}
if [[ "$1" =~ ^(build|run|kill|shell|logs|clean|push)$ ]]; then
echo -e "${YELLOW}WARNING: ${CYAN} this is for development/testing purposes. ${NOCOL}"
$1 $2
else
echo -e "${RED}ERROR: ${NOCOL} couldn't understand $1"
echo -e "try ${CYAN}build | run | kill | shell | logs | clean${NOCOL}"
fi