-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdeploy.bat
More file actions
32 lines (27 loc) · 768 Bytes
/
deploy.bat
File metadata and controls
32 lines (27 loc) · 768 Bytes
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
@echo off
rem Check if two arguments are provided
if "%1"=="" goto :error
if "%2"=="" goto :error
rem Check if argument 1 (type) is either "prod" or "dev"
if /i "%1"=="prod" (
set COMPOSE_FILE=docker-compose.prod.yaml
) else if /i "%1"=="dev" (
set COMPOSE_FILE=docker-compose.dev.yaml
) else (
goto :error
)
rem Check if argument 2 (UporDown) is either "up" or "down"
if /i "%2"=="up" (
set ACTION=up
) else if /i "%2"=="down" (
set ACTION=down
) else (
goto :error
)
rem Execute docker-compose command
echo Running docker-compose -f docker-compose.yaml -f %COMPOSE_FILE% %ACTION%
docker-compose -f docker-compose.yaml -f %COMPOSE_FILE% %ACTION%
goto :eof
:error
echo Error: Arguments should follow the format "prod|dev up|down"
goto :eof