Uploading Everything
Uploading Every Docker Compose YML file to the Repo
This commit is contained in:
71
Update-DockerStacks.ps1
Normal file
71
Update-DockerStacks.ps1
Normal file
@@ -0,0 +1,71 @@
|
||||
# ==============================================================================
|
||||
# CONFIGURATION
|
||||
# ==============================================================================
|
||||
|
||||
$RootPath = "C:\Users\MohandL3G\Nextcloud\Scripts & Commands\Docker\Compose"
|
||||
|
||||
$ServicesToUpdate = @(
|
||||
"Cup",
|
||||
"Heimdall",
|
||||
"Immich",
|
||||
"Jellyfin",
|
||||
"Jellyseerr",
|
||||
"metube",
|
||||
"n8n",
|
||||
"Newt",
|
||||
"Nextcloud",
|
||||
"Nexterm",
|
||||
"NPM",
|
||||
"Portainer-CE",
|
||||
"Zerobyte"
|
||||
# "FutureApp"
|
||||
)
|
||||
|
||||
# ==============================================================================
|
||||
# EXECUTION LOGIC
|
||||
# ==============================================================================
|
||||
|
||||
Write-Host "Starting Docker Stack Updates..." -ForegroundColor Cyan
|
||||
Write-Host "--------------------------------" -ForegroundColor Gray
|
||||
|
||||
foreach ($Service in $ServicesToUpdate) {
|
||||
$ServicePath = Join-Path -Path $RootPath -ChildPath $Service
|
||||
|
||||
if (Test-Path -Path $ServicePath) {
|
||||
Write-Host "`n[$Service] Checking..." -ForegroundColor Yellow
|
||||
Push-Location -Path $ServicePath
|
||||
|
||||
try {
|
||||
# 1. PULL: This will show progress bars directly in your console.
|
||||
docker compose pull
|
||||
|
||||
# 2. UP: This acts as the "Check".
|
||||
# If the image is new, it recreates the container.
|
||||
# If the image is old, it says "Up to date" and keeps running.
|
||||
docker compose up -d --remove-orphans --no-build
|
||||
|
||||
Write-Host "[$Service] Done." -ForegroundColor Green
|
||||
}
|
||||
catch {
|
||||
Write-Host "[$Service] ERROR: Something went wrong." -ForegroundColor Red
|
||||
}
|
||||
finally {
|
||||
Pop-Location
|
||||
}
|
||||
}
|
||||
else {
|
||||
Write-Host "`n[$Service] WARNING: Folder not found at $ServicePath" -ForegroundColor Red
|
||||
}
|
||||
}
|
||||
|
||||
# ==============================================================================
|
||||
# CLEANUP
|
||||
# ==============================================================================
|
||||
|
||||
Write-Host "`n--------------------------------" -ForegroundColor Gray
|
||||
Write-Host "Cleaning up unused images..." -ForegroundColor Yellow
|
||||
|
||||
docker image prune -f
|
||||
|
||||
Write-Host "Cleanup Complete." -ForegroundColor Green
|
||||
Write-Host "All requested updates finished." -ForegroundColor Cyan
|
||||
Reference in New Issue
Block a user