-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdeploy.bat
More file actions
38 lines (32 loc) · 803 Bytes
/
deploy.bat
File metadata and controls
38 lines (32 loc) · 803 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
33
34
35
36
37
38
@echo off
set ENV=%1
if "%ENV%"=="" (
echo You must provide an environment: dev or stg
exit /b 1
)
echo Starting deployment for environment: %ENV%
if "%ENV%"=="dev" (
set COMPOSE_FILE=docker-compose.dev.yml
) else if "%ENV%"=="stg" (
set COMPOSE_FILE=docker-compose.stg.yml
) else (
echo Unknown environment. Use 'dev' or 'stg'.
exit /b 1
)
if not exist %COMPOSE_FILE% (
echo The file %COMPOSE_FILE% does not exist.
exit /b 1
)
echo Compiling the project...
call mvnw.cmd clean package
if %errorlevel% neq 0 (
echo Compilation failed
exit /b 1
)
echo Starting containers with %COMPOSE_FILE%...
docker-compose -f %COMPOSE_FILE% up --build -d
if %errorlevel% neq 0 (
echo Deployment failed
exit /b 1
)
echo Deployment successful for environment %ENV%.