forked from kuhn-ruess/cmdbsyncer
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathhelper
executable file
·48 lines (47 loc) · 1.38 KB
/
helper
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
#!/bin/bash
# Simple Helper
# .local.
CONTAINER=cmdb_syncer
APPLICATION=cmdb_syncer-api-1
case "$1" in
"up")
docker-compose -f docker-compose.yml -f docker-compose.local.yml -p $CONTAINER rm
docker-compose -f docker-compose.yml -f docker-compose.local.yml -p $CONTAINER up --build --force-recreate -d
;;
"start")
docker-compose -f docker-compose.yml -f docker-compose.local.yml -p $CONTAINER start
;;
"stop")
docker-compose -f docker-compose.yml -f docker-compose.local.yml -p $CONTAINER stop
;;
"restart")
docker-compose -f docker-compose.yml -f docker-compose.local.yml -p $CONTAINER stop
docker-compose -f docker-compose.yml -f docker-compose.local.yml -p $CONTAINER start
;;
"down")
docker-compose -f docker-compose.yml -f docker-compose.local.yml -p $CONTAINER down --rmi local --remove-orphans
;;
"cmdbsyncer")
docker exec -it $APPLICATION ./"$@"
;;
"logs")
echo "Start Container Logs"
docker logs -f $APPLICATION
;;
"shell")
echo "Start Container Shell"
docker exec -it $APPLICATION sh
;;
"create_user")
echo "Create User"
docker exec -it $APPLICATION ./cmdbsyncer sys create_user "$2"
;;
"bve")
python3 -m venv ENV
;;
*)
echo "Simple Helper for CMDB Syncer Jobs."
echo "For Docker Compose: up, down, start, stop, logs and shell are the options"
echo "Create a venv with bve"
;;
esac