From 08ab24a72dd7dace092241229bbb58e9ee4c07d2 Mon Sep 17 00:00:00 2001 From: sabrina-datadog Date: Wed, 16 Oct 2024 13:42:33 -0400 Subject: [PATCH] test with nightly s3 url --- .../Generate-Chocolatey-Package.ps1 | 20 +++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/tasks/winbuildscripts/Generate-Chocolatey-Package.ps1 b/tasks/winbuildscripts/Generate-Chocolatey-Package.ps1 index d308ad60467ef2..32142ed1f79b59 100644 --- a/tasks/winbuildscripts/Generate-Chocolatey-Package.ps1 +++ b/tasks/winbuildscripts/Generate-Chocolatey-Package.ps1 @@ -15,12 +15,12 @@ $env:chocolateyUseWindowsCompression = 'true'; Invoke-Expression ((New-Object Sy pip3 install -r requirements.txt $outputDirectory = "c:\mnt\build-out" -$rawAgentVersion = (inv agent.version) +$rawAgentVersion = (inv agent.version --url-safe --major-version 7) $copyright = "Datadog {0}" -f (Get-Date).Year $releasePattern = "(\d+\.\d+\.\d+)" $releaseCandidatePattern = "(\d+\.\d+\.\d+)-rc\.(\d+)" -$develPattern = "(\d+\.\d+\.\d+)-devel\+git\.\d+\.(.+)" +$develPattern = "(\d+\.\d+\.\d+)-devel\.git\.\d+\.(.+)" $nuspecFile = "c:\mnt\chocolatey\datadog-agent-online.nuspec" $licensePath = "c:\mnt\chocolatey\tools-online\LICENSE.txt" @@ -38,14 +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") { - $url = "https://s3.amazonaws.com/test-windows/ddagent-cli-$($agentVersion).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-$($rawAgentVersion).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) { @@ -61,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 @@ -70,8 +71,7 @@ if ($installMethod -eq "online") { $statusCode = -1 try { Get-ChildItem "$(Get-Location)\temp" - $version = "{0}-1" -f (inv agent.version --url-safe --major-version 7) - $tempMsi = "$(Get-Location)\temp\datadog-agent-$version-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