forked from pewdiepie-archdaemon/odysseus
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathupdate_windows.bat
More file actions
59 lines (48 loc) · 1.22 KB
/
Copy pathupdate_windows.bat
File metadata and controls
59 lines (48 loc) · 1.22 KB
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
@echo off
setlocal
title Update Odysseus Docker Deployment
pushd "%~dp0" >nul
echo =========================================
echo Updating Odysseus Docker deployment
echo =========================================
echo.
where git >nul 2>nul
if errorlevel 1 (
echo [!] Git was not found on PATH.
echo Install Git for Windows, then run this script again.
goto :fail
)
where docker >nul 2>nul
if errorlevel 1 (
echo [!] Docker was not found on PATH.
echo Start Docker Desktop, then run this script again.
goto :fail
)
docker compose version >nul 2>nul
if errorlevel 1 (
echo [!] Docker Compose is not available.
echo Update Docker Desktop, then run this script again.
goto :fail
)
echo [+] Pulling latest code...
git pull --ff-only
if errorlevel 1 goto :fail
echo.
echo [+] Rebuilding and restarting containers...
docker compose up -d --build
if errorlevel 1 goto :fail
echo.
echo [+] Removing dangling Docker images...
docker image prune -f
if errorlevel 1 goto :fail
echo.
echo =========================================
echo Update completed successfully.
echo =========================================
goto :done
:fail
echo.
echo Update failed. Check the message above and try again.
:done
popd >nul
pause