39 lines
1014 B
PowerShell
39 lines
1014 B
PowerShell
<#
|
|
.SYNOPSIS
|
|
Exécute deploy-img.sh dans WSL Debian pour pousser Imago vers le registre.
|
|
.DESCRIPTION
|
|
Lance le script Bash deploy-img.sh sous WSL Debian qui tague et pousse
|
|
l'image vers dev.lab.home:5000 avec versioning semver.
|
|
.EXEMPLE
|
|
.\deploy-img.ps1
|
|
#>
|
|
|
|
param()
|
|
|
|
$ErrorActionPreference = 'Stop'
|
|
|
|
try {
|
|
$scriptDir = $PSScriptRoot
|
|
$wslScriptDir = $scriptDir -replace '^([A-Za-z]):\\', '/mnt/$1/' -replace '\\', '/'
|
|
$wslScriptDir = $wslScriptDir.ToLower()
|
|
|
|
Write-Host "Déploiement de l'image Imago vers le registre..." -ForegroundColor Cyan
|
|
|
|
# Rendre le script exécutable
|
|
wsl -d Debian -- chmod +x "$wslScriptDir/deploy-img.sh"
|
|
|
|
# Exécuter
|
|
$innerCmd = "cd '$wslScriptDir' && ./deploy-img.sh"
|
|
wsl -d Debian bash -lc $innerCmd
|
|
|
|
if ($LASTEXITCODE -ne 0) {
|
|
throw "Le déploiement a échoué (code: $LASTEXITCODE)"
|
|
}
|
|
|
|
Write-Host "Déploiement terminé avec succès." -ForegroundColor Green
|
|
}
|
|
catch {
|
|
Write-Error "Erreur : $_"
|
|
exit 1
|
|
}
|