-
Notifications
You must be signed in to change notification settings - Fork 5
/
admin.bat
executable file
·70 lines (59 loc) · 1.17 KB
/
admin.bat
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
@echo off
SET USAGE="Usage: init.sh up|down|build|ls|shell [php7|php8|nginx|mysql] -- 2nd argument is the container (used with shell option)"
# If you're using %DOCKER%, change these two env vars
# replace "podman" with "%DOCKER%"
SET DOCKER=podman
SET COMPOSE=podman-compose
SET INIT=0
CALL secrets.cmd
IF "%~1"=="" GOTO :done
:lets_go
IF "%1"=="up" GOTO :up
IF "%1"=="start" GOTO :up
GOTO :opt2
:up
%COMPOSE% up -d
GOTO:EOF
:opt2
IF "%1" =="down" GOTO :down
IF "%1"=="stop" GOTO :down
GOTO :opt3
:down
%COMPOSE% down
takeown /R /F *
GOTO:EOF
:opt3
IF "%1"=="build" GOTO :build
GOTO :opt4
:build
%COMPOSE% build
GOTO:EOF
:opt4
IF "%1"=="ls" GOTO :ls
GOTO :opt5
:ls
%DOCKER% container ls
GOTO:EOF
:opt5
IF "%1"=="shell" GOTO :shell
GOTO :done
:shell
IF "$2" == "php7" GOTO :shell_php7
IF "$2" == "nginx" GOTO :shell_nginx
IF "$2" == "mysql" GOTO :shell_mysql
%DOCKER% exec -it %CONTAINER_PHP8% /bin/bash
GOTO:EOF
:shell_php7
%DOCKER% exec -it %CONTAINER_PHP7% /bin/bash
GOTO:EOF
:shell_nginx
%DOCKER% exec -it %CONTAINER_NGINX% /bin/bash
GOTO:EOF
:shell_mysql
%DOCKER% exec -it %CONTAINER_MYSQL% /bin/bash
GOTO:EOF
:done
echo "Done"
echo %USAGE%
echo "You entered %1 and %1"
GOTO:EOF