Uh oh!
There was an error while loading. Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork 6
Expand file tree
/
Copy pathsmanager
More file actions
Latest commit
executable file
·108 lines (92 loc) · 1.87 KB
/
Copy pathsmanager
File metadata and controls
executable file
·108 lines (92 loc) · 1.87 KB
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
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
#!/usr/bin/env bash
SCRIPT_NAME=$(basename $0)
functionprint_help() {
echo"Usage:"
echo"$SCRIPT_NAME COMMAND [SERVICES]"
echo""
echo"Commands:"
echo" help Print help"
echo" up Create and run containers for a service"
echo" down Stops containers and removes containers, networks, volumes, and images"
echo" start Starts existing containers for aservice"
echo" stop Stops running containers without removing them"
echo" restart Restarts all stopped and running containers for service"
echo" rebuild Rebuild service"
}
functioninstall_frontend_modules() {
docker-compose run --rm --no-deps -u node frontend bash -ci "npm install"
}
functioninstall_backend_modules() {
docker-compose run --rm --no-deps backend bash -ci "pip install --no-cache-dir -e ".[testing]""
}
functioninstall_missing_modules() {
local node_modules_folder="./frontend/node_modules/"
local python_modules_folder="./easyrest.egg-info/"
if! [ -d$node_modules_folder ]
then
install_frontend_modules
fi
if! [ -d$python_modules_folder ]
then
install_backend_modules
fi
}
functionrebuild_services() {
docker-compose build $@
forparamin$*
do
install_$param_modules
done
}
functionup_services() {
install_missing_modules
docker-compose up -d $@
}
functiondown_services() {
docker-compose down $@
}
functionstart_services() {
docker-compose start $@
}
functionstop_services() {
docker-compose stop $@
}
functionrestart_services() {
docker-compose restart $@
}
if [ $#= 0 ];then
print_help
exit
fi
case$1in
up )
shift
up_services $@
;;
down )
shift
down_services $@
;;
start )
shift
start_services $@
;;
stop )
shift
stop_services $@
;;
restart )
shift
restart_services $@
;;
rebuild )
shift
rebuild_services $@
;;
help )
print_help
;;
* )
echo"$1 is not an option"
;;
esac