- Sidebar portfolio con metriche dettagliate (Totale, Investito, Disponibile, P&L, ROI) e aggiornamento real-time - Sistema multi-strategia: 8 strategie assegnabili per asset, voting decisionale, pagina Trading Control - Nuova pagina Posizioni: gestione, chiusura manuale, P&L non realizzato, notifiche - Sistema indicatori tecnici: 7+ indicatori configurabili, segnali real-time, raccomandazioni, storico segnali - Refactoring TradingBotService per capitale, P&L, ROI, eventi - Nuovi modelli e servizi per strategie/indicatori, persistenza configurazioni - UI/UX: navigazione aggiornata, widget, modali, responsive - Aggiornamento README e CHANGELOG con tutte le novità
114 lines
4.1 KiB
PowerShell
114 lines
4.1 KiB
PowerShell
#!/usr/bin/env pwsh
|
|
<#
|
|
.SYNOPSIS
|
|
Manual push of Docker image to Gitea Registry
|
|
.DESCRIPTION
|
|
Pushes the local tradingbot:latest image to Gitea Registry with proper tags
|
|
Use this when Visual Studio Publish was done without Docker running
|
|
#>
|
|
|
|
param(
|
|
[string]$Version = "1.3.0"
|
|
)
|
|
|
|
$ErrorActionPreference = "Stop"
|
|
|
|
Write-Host ""
|
|
Write-Host "========================================" -ForegroundColor Cyan
|
|
Write-Host "?? Manual Gitea Registry Push" -ForegroundColor Cyan
|
|
Write-Host "========================================" -ForegroundColor Cyan
|
|
Write-Host ""
|
|
|
|
# Check Docker
|
|
Write-Host "?? Checking Docker..." -ForegroundColor Yellow
|
|
try {
|
|
docker version | Out-Null
|
|
Write-Host "? Docker is running" -ForegroundColor Green
|
|
} catch {
|
|
Write-Host "? Docker is not running!" -ForegroundColor Red
|
|
Write-Host " Please start Docker Desktop first" -ForegroundColor Yellow
|
|
exit 1
|
|
}
|
|
Write-Host ""
|
|
|
|
# Check local image exists
|
|
Write-Host "?? Checking local image..." -ForegroundColor Yellow
|
|
$localImage = docker images --format "{{.Repository}}:{{.Tag}}" | Select-String "^tradingbot:latest$"
|
|
if (-not $localImage) {
|
|
Write-Host "? Local image 'tradingbot:latest' not found!" -ForegroundColor Red
|
|
Write-Host " Please run Visual Studio Publish first" -ForegroundColor Yellow
|
|
exit 1
|
|
}
|
|
Write-Host "? Local image found: tradingbot:latest" -ForegroundColor Green
|
|
Write-Host ""
|
|
|
|
# Configuration
|
|
$registry = "gitea.encke-hake.ts.net"
|
|
$repository = "alby96/encelado/tradingbot"
|
|
$giteaImage = "$registry/$repository"
|
|
$buildDate = Get-Date -Format "yyyyMMdd"
|
|
$versionedTag = "$Version-$buildDate"
|
|
|
|
Write-Host "?? Version: $Version" -ForegroundColor Cyan
|
|
Write-Host "?? Build Date: $buildDate" -ForegroundColor Cyan
|
|
Write-Host ""
|
|
|
|
# Create tags
|
|
Write-Host "??? Creating tags..." -ForegroundColor Yellow
|
|
|
|
Write-Host " Tagging: ${giteaImage}:latest" -ForegroundColor Gray
|
|
docker tag tradingbot:latest "${giteaImage}:latest"
|
|
Write-Host " ? latest" -ForegroundColor Green
|
|
|
|
Write-Host " Tagging: ${giteaImage}:$Version" -ForegroundColor Gray
|
|
docker tag tradingbot:latest "${giteaImage}:$Version"
|
|
Write-Host " ? $Version" -ForegroundColor Green
|
|
|
|
Write-Host " Tagging: ${giteaImage}:$versionedTag" -ForegroundColor Gray
|
|
docker tag tradingbot:latest "${giteaImage}:$versionedTag"
|
|
Write-Host " ? $versionedTag" -ForegroundColor Green
|
|
|
|
Write-Host ""
|
|
|
|
# Push to Gitea
|
|
Write-Host "?? Pushing to $registry..." -ForegroundColor Yellow
|
|
Write-Host ""
|
|
|
|
Write-Host " Pushing: latest..." -ForegroundColor Gray
|
|
docker push "${giteaImage}:latest"
|
|
Write-Host " ? Pushed: latest" -ForegroundColor Green
|
|
|
|
Write-Host " Pushing: $Version..." -ForegroundColor Gray
|
|
docker push "${giteaImage}:$Version"
|
|
Write-Host " ? Pushed: $Version" -ForegroundColor Green
|
|
|
|
Write-Host " Pushing: $versionedTag..." -ForegroundColor Gray
|
|
docker push "${giteaImage}:$versionedTag"
|
|
Write-Host " ? Pushed: $versionedTag" -ForegroundColor Green
|
|
|
|
Write-Host ""
|
|
Write-Host "========================================" -ForegroundColor Green
|
|
Write-Host "? Successfully pushed to Gitea Registry!" -ForegroundColor Green
|
|
Write-Host "========================================" -ForegroundColor Green
|
|
Write-Host ""
|
|
|
|
Write-Host "?? Published images:" -ForegroundColor Cyan
|
|
Write-Host " - ${giteaImage}:latest" -ForegroundColor White
|
|
Write-Host " - ${giteaImage}:$Version" -ForegroundColor White
|
|
Write-Host " - ${giteaImage}:$versionedTag" -ForegroundColor White
|
|
Write-Host ""
|
|
|
|
Write-Host "?? Verify at:" -ForegroundColor Cyan
|
|
Write-Host " https://$registry/Alby96/Encelado/-/packages" -ForegroundColor White
|
|
Write-Host ""
|
|
|
|
Write-Host "?? Next steps:" -ForegroundColor Cyan
|
|
Write-Host " 1. Verify on Gitea Packages (link above)" -ForegroundColor White
|
|
Write-Host " 2. SSH to Unraid: ssh root@192.168.30.23" -ForegroundColor White
|
|
Write-Host " 3. Force update:" -ForegroundColor White
|
|
Write-Host " docker stop TradingBot" -ForegroundColor Gray
|
|
Write-Host " docker rmi $giteaImage:latest" -ForegroundColor Gray
|
|
Write-Host " docker pull $giteaImage:latest" -ForegroundColor Gray
|
|
Write-Host " docker start TradingBot" -ForegroundColor Gray
|
|
Write-Host ""
|