generated from GDGVIT/template
-
Notifications
You must be signed in to change notification settings - Fork 7
/
vitty.cmd
65 lines (58 loc) · 1.8 KB
/
vitty.cmd
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
@echo off
REM Vitty
REM Handy set of commands to run to get a new server up and running
set command=%1
if "%command%" == "local" (
shift
set file=docker-compose-local.yaml
set environment=local
) else (
set file=docker-compose-prod.yaml
set environment=production
)
if "%command%" == "" (
echo.
echo ██╗ ██╗██╗████████╗████████╗██╗ ██╗
echo ██║ ██║██║╚══██╔══╝╚══██╔══╝╚██╗ ██╔╝
echo ██║ ██║██║ ██║ ██║ ╚████╔╝
echo ╚██╗ ██╔╝██║ ██║ ██║ ╚██╔╝
echo ╚████╔╝ ██║ ██║ ██║ ██║
echo ╚═══╝ ╚═╝ ╚═╝ ╚═╝ ╚═╝
echo.
echo.
echo Environment: %environment%
echo.
echo Usage: vitty [command]
echo.
echo Available commands:
echo up: Start the server
echo down: Stop the server
echo restart: Restart the server
echo cli: Run a command inside the container
exit /b 1
)
REM Start server command
if "%command%" == "up" (
echo Starting server
docker compose -f "%file%" up -d --build
exit /b 1
)
REM Stop server command
if "%command%" == "down" (
echo Stopping server
docker compose -f "%file%" down
exit /b 1
)
REM Restart server command
if "%command%" == "restart" (
echo Restarting server
docker compose -f "%file%" down
docker compose -f "%file%" up -d --build
exit /b 1
)
REM Management commands
if "%command%" == "cli" (
shift
docker compose -f "%file%" run --rm vitty-api ./bin/vitty %*
exit /b 1
)