Skip to content

Commit

Permalink
updated windows alloy migration
Browse files Browse the repository at this point in the history
  • Loading branch information
ibalal-intergral committed Jul 10, 2024
1 parent 2d7eaf0 commit e4336ec
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions windows/observability-agent-autoconf.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -48,8 +48,8 @@ while ($args) {
}

if ($INSTALL -ne $false) {
$outputPath = "$PSScriptRoot/alloy-installer-amd64.exe.zip"
$installPath = "$PSScriptRoot/alloy-installer-amd64.exe"
$outputPath = "$PSScriptRoot/alloy-installer-windows-amd64.exe.zip"
$installPath = "$PSScriptRoot/alloy-installer-windows-amd64.exe"

# Download the file
Write-Output "Downloading Grafana Alloy installer"
Expand All @@ -58,7 +58,7 @@ if ($INSTALL -ne $false) {
{
$ProgressPreference = 'SilentlyContinue'
}
Invoke-WebRequest -Uri "https://github.com/grafana/alloy/releases/tag/v1.2.0/alloy-installer-amd64.exe.zip" -OutFile $outputPath
Invoke-WebRequest -Uri "https://github.com/grafana/alloy/releases/download/v1.2.0/alloy-installer-windows-amd64.exe.zip" -OutFile $outputPath

# Extract the contents of the zip file
Write-Output "Extracting Grafana Alloy installer"
Expand All @@ -68,11 +68,11 @@ if ($INSTALL -ne $false) {
Write-Output "Running Grafana Alloy installer"
if ($PROMPT -eq $false)
{
Start-Process "$installPath\alloy-installer-amd64.exe" "/S"
Start-Process "$installPath\alloy-installer-windows-amd64.exe" "/S"
}
else
{
Start-Process "$installPath\alloy-installer-amd64.exe.exe"
Start-Process "$installPath\alloy-installer-windows-amd64.exe"
}
}

Expand Down Expand Up @@ -845,8 +845,8 @@ prometheus.scrape "endpoints" {
}
Write-Output "Config file updated"

Move-Item -Path $CONFIG -Destination "C:\Program Files\Alloy\config.alloy" -Force
Write-Host "Config file can be found at C:\Program Files\Alloy\config.alloy"
Move-Item -Path $CONFIG -Destination "C:\Program Files\GrafanaLabs\Alloy\config.alloy" -Force
Write-Host "Config file can be found at C:\Program Files\GrafanaLabs\Alloy\config.alloy"

# Service might not be created yet if running script with `--prompt false`
# This attempts to wait until the service can be restarted - there's probably a better way to do this
Expand Down

0 comments on commit e4336ec

Please sign in to comment.