Skip to content

Commit

Permalink
fix oob pipeline (Azure#24585)
Browse files Browse the repository at this point in the history
  • Loading branch information
Nickcandy authored Apr 8, 2024
1 parent c8b06c8 commit 93d4879
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 13 deletions.
8 changes: 1 addition & 7 deletions build.proj
Original file line number Diff line number Diff line change
Expand Up @@ -256,13 +256,7 @@
<Exec Command="$(PowerShellCoreCommandPrefix) &quot;. $(RepoTools)CleanupBuild.ps1 -BuildConfig $(Configuration) -GenerateDocumentationFile $(GenerateDocumentationFile) &quot;" />

<Error Condition="'$(NuGetKey)' == ''" Text="You must provide the NuGetKey parameter to the build: /p:NuGetKey=YOUR_PUBLISHING_KEY" />
<Exec Command="$(PowerShellCoreCommandPrefix) &quot;. $(RepoTools)PublishModules.ps1 -TargetBuild $(TargetBuild) -IsNetCore:$$(NetCore) -BuildConfig $(Configuration) -Scope $(Scope) -ApiKey $(NuGetKey) -RepositoryLocation /&quot;$(NuGetPublishingSource)/&quot;&quot; -NugetExe $(NuGetCommand)" />
</Target>

<Target Name="BuildInstaller" AfterTargets="Publish" Condition="('$(Scope)' == 'All' or '$(Scope)' == 'Latest' or '$(Scope)' == 'Netcore')">
<Exec Command="$(PowerShellCoreCommandPrefix) &quot;. Register-PSRepository -Name MSIcreationrepository -SourceLocation $(RepoArtifacts) -InstallationPolicy Trusted &quot;" />
<Exec Command="$(PowerShellCoreCommandPrefix) &quot;. $(RepoRoot)/setup/generate.ps1 -repository MSIcreationrepository &quot;" />
<Exec Command="$(PowerShellCoreCommandPrefix) &quot;. Unregister-PSRepository -Name MSIcreationrepository &quot;" />
<Exec Command="$(PowerShellCoreCommandPrefix) &quot;. $(RepoTools)PublishModules.ps1 -TargetBuild $(TargetBuild) -IsNetCore:$$(NetCore) -BuildConfig $(Configuration) -Scope $(Scope) -ApiKey $(NuGetKey) -RepositoryLocation &quot;$(NuGetPublishingSource)&quot;&quot; -NugetExe $(NuGetCommand)" />
</Target>

<Target Name="BuildImages">
Expand Down
2 changes: 1 addition & 1 deletion tools/PublishModules.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ if ($PublishLocal) {
$null = New-Item -ItemType Directory -Force -Path $tempRepoPath
$tempRepoName = ([System.Guid]::NewGuid()).ToString()
$repo = Get-PSRepository | Where-Object { $_.SourceLocation -eq $tempRepoPath }
if ($repo -ne $null) {
if ($null -ne $repo) {
$tempRepoName = $repo.Name
} else {
Register-PSRepository -Name $tempRepoName -SourceLocation $tempRepoPath -PublishLocation $tempRepoPath -InstallationPolicy Trusted -PackageManagementProvider NuGet
Expand Down
12 changes: 7 additions & 5 deletions tools/PublishModules.psm1
Original file line number Diff line number Diff line change
Expand Up @@ -275,21 +275,20 @@ function Get-AllModules {
)
Write-Host "Getting Azure client modules"
$clientModules = Get-ClientModules -BuildConfig $BuildConfig -Scope $Scope -PublishLocal:$PublishLocal -IsNetCore:$isNetCore
Write-Host " "

if($clientModules.Length -le 2 -and $TargetBuild -eq "true") {
Write-Host "$clientModules"
if($clientModules.Count -le 2 -and $TargetBuild -eq "true") {
return @{
ClientModules = $clientModules
}
}

Write-Host "Getting admin modules"
$adminModules = Get-AdminModules -BuildConfig $BuildConfig -Scope $Scope
Write-Host " "
Write-Host "$adminModules"

Write-Host "Getting rollup modules"
$rollupModules = Get-RollupModules -BuildConfig $BuildConfig -Scope $Scope -IsNetCore:$isNetCore
Write-Host " "
Write-Host "$rollupModules"

return @{
ClientModules = $clientModules;
Expand Down Expand Up @@ -592,6 +591,9 @@ function Add-AllModules {
foreach ($package in $packages) {
$fileName = $package.Name
$versionString = $fileName.Replace('Az.Accounts.', '').Replace('.nupkg', '')
if ($versionString -match 'preview') {
return
}
$version = [version]$versionString

if ($version -gt $latestVersion) {
Expand Down

0 comments on commit 93d4879

Please sign in to comment.