Skip to content

Commit

Permalink
add -1 to rawAgentVersion
Browse files Browse the repository at this point in the history
  • Loading branch information
sabrina-datadog committed Oct 16, 2024
1 parent d44c7ec commit 6b3042d
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions tasks/winbuildscripts/Generate-Chocolatey-Package.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand All @@ -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
Expand All @@ -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
Expand Down

0 comments on commit 6b3042d

Please sign in to comment.