From f2ef987cec921d607db9389ee2d5ba4a902a7daf Mon Sep 17 00:00:00 2001 From: panotuco Date: Thu, 9 Apr 2026 10:45:47 +0200 Subject: [PATCH] Eliminar update_conf_Alloy.ps1 --- update_conf_Alloy.ps1 | 41 ----------------------------------------- 1 file changed, 41 deletions(-) delete mode 100644 update_conf_Alloy.ps1 diff --git a/update_conf_Alloy.ps1 b/update_conf_Alloy.ps1 deleted file mode 100644 index b582226..0000000 --- a/update_conf_Alloy.ps1 +++ /dev/null @@ -1,41 +0,0 @@ -# --- Configuración --- -$repoDir = "C:\lab_git\dex" -$repoUrl = "https://git.insidemicro.com/panotuco/dex.git" -$alloyConfigPath = "C:\Program Files\GrafanaLabs\Alloy\config.alloy" -$serviceName = "alloy" - -# --- 1. Gestión del repositorio --- -if (-not (Test-Path $repoDir)) { - New-Item -ItemType Directory -Force -Path $repoDir - git clone $repoUrl $repoDir -} - -cd $repoDir -git fetch origin - -# --- 2. Comprobación de cambios --- -$localHash = git rev-parse HEAD -$remoteHash = git rev-parse origin/main # Verifica si tu rama es 'main' o 'master' - -if ($localHash -ne $remoteHash) { - Write-Host "Nueva configuración detectada en Git..." -ForegroundColor Cyan - - # Descargar cambios - git reset --hard origin/main - - # El archivo en el repo debe llamarse igual o ajusta esta línea: - $sourceFile = Join-Path $repoDir "config.alloy" - - if (Test-Path $sourceFile) { - # --- 3. Sobrescribir archivo en Program Files --- - Copy-Item -Path $sourceFile -Destination $alloyConfigPath -Force - Write-Host "Archivo config.alloy actualizado." -ForegroundColor Green - - # --- 4. Reiniciar servicio --- - Write-Host "Reiniciando servicio Grafana Alloy..." -ForegroundColor Yellow - Restart-Service -Name $serviceName -ErrorAction SilentlyContinue - Write-Host "Proceso finalizado." -ForegroundColor Green - } -} else { - Write-Host "Sin cambios. Alloy está actualizado." -} \ No newline at end of file