From 6b3042d3a4872c847a793c9967058c28b5836a8e Mon Sep 17 00:00:00 2001 From: sabrina-datadog Date: Wed, 16 Oct 2024 15:17:57 -0400 Subject: [PATCH] add -1 to rawAgentVersion --- .../Generate-Chocolatey-Package.ps1 | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/tasks/winbuildscripts/Generate-Chocolatey-Package.ps1 b/tasks/winbuildscripts/Generate-Chocolatey-Package.ps1 index 437e9a0242a172..ab8ea599272b38 100644 --- a/tasks/winbuildscripts/Generate-Chocolatey-Package.ps1 +++ b/tasks/winbuildscripts/Generate-Chocolatey-Package.ps1 @@ -38,15 +38,14 @@ if ($rawAgentVersion -match $releaseCandidatePattern) { $releaseNotes = "https://github.com/DataDog/datadog-agent/releases/tag/{0}-rc.{1}" -f $agentVersionMatches.Matches.Groups[1], $agentVersionMatches.Matches.Groups[2] $url = "https://s3.amazonaws.com/dd-agent-mstesting/builds/beta/ddagent-cli-$($agentVersionMatches.Matches.Groups[1])-rc.$($agentVersionMatches.Matches.Groups[2]).msi" } elseif ($rawAgentVersion -match $develPattern) { - if ($installMethod -eq "online") { - $testVersion = $rawAgentVersion -replace '-1$', '' - $url = "https://s3.amazonaws.com/ddagent-windows-trial/nightly/ddagent-cli-$($testVersion).msi" - # We don't publish online chocolatey packages for dev branches, error out - # Write-Host "Chocolatey packages are not built for dev branches aborting" - # exit 2 - } + # if ($installMethod -eq "online") { + # # We don't publish online chocolatey packages for dev branches, error out + # Write-Host "Chocolatey packages are not built for dev branches aborting" + # exit 2 + # } $agentVersionMatches = $rawAgentVersion | Select-String -Pattern $develPattern $agentVersion = "{0}-devel-{1}" -f $agentVersionMatches.Matches.Groups[1], $agentVersionMatches.Matches.Groups[2].Value + $url = "https://s3.amazonaws.com/ddagent-windows-trial/nightly/ddagent-cli-$($agentVersion).msi" # We don't have release notes for devel, so point it to the generic url $releaseNotes = "https://github.com/DataDog/datadog-agent/releases" } elseif ($rawAgentVersion -match $releasePattern) { @@ -62,6 +61,7 @@ if ($rawAgentVersion -match $releaseCandidatePattern) { Invoke-WebRequest -Uri "https://raw.githubusercontent.com/DataDog/datadog-agent/main/LICENSE" -OutFile $licensePath Write-Host "Generating Chocolatey $installMethod package version $agentVersion in $outputDirectory" +Write-Host "rawAgentVersion: $rawAgentVersion" if (!(Test-Path $outputDirectory)) { New-Item -ItemType Directory -Path $outputDirectory @@ -71,7 +71,7 @@ if ($installMethod -eq "online") { $statusCode = -1 try { Get-ChildItem "$(Get-Location)\temp" - $tempMsi = "$(Get-Location)\temp\datadog-agent-$rawAgentVersion-x86_64.msi" + $tempMsi = "$(Get-Location)\temp\datadog-agent-$rawAgentVersion-1-x86_64.msi" if (-not (Test-Path $tempMsi)) { Write-Host "Could not find msi file in this path: $tempMsi" exit 1