Skip to content

Commit

Permalink
test with nightly s3 url
Browse files Browse the repository at this point in the history
  • Loading branch information
sabrina-datadog committed Oct 16, 2024
1 parent 780039a commit 08ab24a
Showing 1 changed file with 10 additions and 10 deletions.
20 changes: 10 additions & 10 deletions tasks/winbuildscripts/Generate-Chocolatey-Package.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand All @@ -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) {
Expand All @@ -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
Expand All @@ -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
Expand Down

0 comments on commit 08ab24a

Please sign in to comment.