File: Create-ApiReview.ps1

package info (click to toggle)
golang-github-azure-azure-sdk-for-go 68.0.0-2
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, forky, sid, trixie
  • size: 556,256 kB
  • sloc: javascript: 196; sh: 96; makefile: 7
file content (35 lines) | stat: -rw-r--r-- 1,388 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
Param(
    [Parameter(Mandatory=$True)]
    [string] $ServiceDirectory,
    [Parameter(Mandatory=$True)]
    [string] $OutPath,
    [Parameter(Mandatory=$True)]
    [string] $ApiviewUri,
    [Parameter(Mandatory=$True)]
    [string] $ApiKey,
    [Parameter(Mandatory=$True)]
    [string] $ApiLabel,
    [Parameter(Mandatory=$True)]
    [string] $SourceBranch,
    [Parameter(Mandatory=$True)]
    [string] $DefaultBranch,
    [Parameter(Mandatory=$True)]
    [string] $ConfigFileDir
)


Write-Host "$PSScriptRoot"
. (Join-Path $PSScriptRoot .. common scripts common.ps1)
$createReviewScript = (Join-Path $PSScriptRoot .. common scripts Create-APIReview.ps1)

foreach ($sdk in (Get-AllPackageInfoFromRepo $ServiceDirectory))
{
    Write-Host "Creating API review artifact for $($sdk.Name)"
    New-Item -ItemType Directory -Path $OutPath/$($sdk.Name) -force
    $fileName = Split-Path -Path $sdk.Name -Leaf
    Compress-Archive -Path $sdk.DirectoryPath -DestinationPath $outPath/$($sdk.Name)/$fileName -force
    Rename-Item $outPath/$($sdk.Name)/$fileName.zip -NewName "$fileName.gosource"

    Write-Host "Send request to APIView to create review for $($sdk.Name)"
    &($createReviewScript) -ArtifactPath $outPath -APIViewUri $ApiviewUri -APIKey $ApiKey -APILabel $ApiLabel -PackageName $sdk.Name -SourceBranch $SourceBranch -DefaultBranch $DefaultBranch -ConfigFileDir $ConfigFileDir
}