-
Notifications
You must be signed in to change notification settings - Fork 19
/
Copy pathlaunch-docker.bat
42 lines (31 loc) · 1.06 KB
/
launch-docker.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
@echo off
rem Set the container name
set CONTAINER_NAME=queue-bot
rem Check if the container is running
docker ps -q -f name=%CONTAINER_NAME% > nul 2>&1
if %errorlevel% equ 0 (
rem Create a dated log file name
set LOG_FILE=logs\%CONTAINER_NAME%_%date:~10,4%-%date:~4,2%-%date:~7,2%_%time:~0,2%-%time:~3,2%-%time:~6,2%.log
rem Save the logs to the file
mkdir logs 2>nul
docker logs %CONTAINER_NAME% > %LOG_FILE%
rem Check if the logs were saved successfully
if %errorlevel% equ 0 (
echo Logs saved to %LOG_FILE%
) else (
echo Failed to save logs
exit /b 1
)
) else (
echo Container %CONTAINER_NAME% is not running. Skipping log saving.
)
# Fetch the latest changes from the remote repository
git fetch
# Merge the fetched changes with a custom commit message
git merge --no-ff -m "Merged changes from remote repository."
docker-compose down
npx drizzle-kit push
docker-compose up -d --build
docker image prune -f
echo "Attaching to container ${CONTAINER_NAME}... (CTRL+p CTRL+q to detach)"
docker logs -f queue-bot