-
Notifications
You must be signed in to change notification settings - Fork 19
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
8 changed files
with
99 additions
and
21 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -7,5 +7,6 @@ docker-compose.yml | |
.gitignore | ||
.idea | ||
|
||
data/main.sqlite | ||
data/backups | ||
data/backups | ||
logs | ||
docs |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
@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. | ||
) | ||
|
||
git pull | ||
|
||
docker-compose down | ||
|
||
npx drizzle-kit push | ||
|
||
docker-compose up -d --build | ||
|
||
docker image prune -f | ||
|
||
docker logs -f queue-bot |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
# Set the container name | ||
CONTAINER_NAME="queue-bot" | ||
|
||
# Check if the container is running | ||
if [ "$(docker ps -q -f name=${CONTAINER_NAME})" ]; then | ||
# Create a dated log file name | ||
LOG_FILE="logs/${CONTAINER_NAME}_$(date +'%Y-%m-%d_%H-%M-%S').log" | ||
|
||
# Save the logs to the file | ||
mkdir -p logs | ||
docker logs -t $CONTAINER_NAME >& $LOG_FILE | ||
|
||
# Check if the logs were saved successfully | ||
if [ $? -eq 0 ]; then | ||
echo "Logs saved to $LOG_FILE" | ||
else | ||
echo "Failed to save logs" | ||
exit 1 | ||
fi | ||
else | ||
echo "Container ${CONTAINER_NAME} is not running. Skipping log saving." | ||
fi | ||
|
||
git pull | ||
|
||
docker compose down | ||
|
||
docker compose up -d --build | ||
|
||
docker image prune -f | ||
|
||
docker attach queue-bot |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters