Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Create package property file using artifact name #1374

Merged
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions eng/common/pipelines/templates/steps/create-apireview.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
parameters:
ArtifactPath: $(Build.ArtifactStagingDirectory)
Artifacts: []
ConfigFileDir: ''

steps:
- ${{ each artifact in parameters.Artifacts }}:
Expand All @@ -13,6 +14,7 @@ steps:
-APIKey $(azuresdk-apiview-apikey)
-APILabel "Auto Review - $(Build.SourceVersion)"
-PackageName ${{artifact.name}}
-ConfigFileDir ${{parameters.ConfigFileDir}}
pwsh: true
workingDirectory: $(Pipeline.Workspace)
displayName: Create API Review for ${{ artifact.name}}
Expand Down
1 change: 1 addition & 0 deletions eng/common/scripts/Package-Properties.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ class PackageProps
[string]$Group
[string]$SdkType
[boolean]$IsNewSdk
[string]$ArtifactName

PackageProps([string]$name, [string]$version, [string]$directoryPath, [string]$serviceDirectory)
{
Expand Down
14 changes: 11 additions & 3 deletions eng/common/scripts/Save-Package-Properties.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -10,15 +10,24 @@ Param (
$allPackageProperties = Get-AllPkgProperties $serviceDirectory
if ($allPackageProperties)
{
New-Item -ItemType Directory -Force -Path $outDirectory
if (-not (Test-Path -Path $outDirectory))
{
New-Item -ItemType Directory -Force -Path $outDirectory
}
foreach($pkg in $allPackageProperties)
{
if ($pkg.IsNewSdk)
{
Write-Host "Package Name: $($pkg.Name)"
Write-Host "Package Version: $($pkg.Version)"
Write-Host "Package SDK Type: $($pkg.SdkType)"
$outputPath = Join-Path -Path $outDirectory ($pkg.Name + ".json")
Write-Host "Artifact Name: $($pkg.ArtifactName)"
$configFilePrefix = $pkg.Name
if ($pkg.ArtifactName)
{
$configFilePrefix = $pkg.ArtifactName
}
$outputPath = Join-Path -Path $outDirectory "$configFilePrefix.json"
$outputObject = $pkg | ConvertTo-Json
Set-Content -Path $outputPath -Value $outputObject
}
Expand All @@ -31,4 +40,3 @@ else
Write-Error "Package properties are not available for service directory $($serviceDirectory)"
exit 1
}