Skip to content

Commit

Permalink
Sync eng/common directory with azure-sdk-tools repository (#12491)
Browse files Browse the repository at this point in the history
  • Loading branch information
azure-sdk committed Jul 11, 2020
1 parent 8f1365a commit 8fb4e2c
Show file tree
Hide file tree
Showing 3 changed files with 28 additions and 14 deletions.
4 changes: 3 additions & 1 deletion eng/common/pipelines/templates/steps/verify-links.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
parameters:
Directory: 'not-specified'
IgnoreLinksFile: "$(Build.SourcesDirectory)/eng/ignore-links.txt"


steps:
- task: PowerShell@2
Expand All @@ -9,4 +11,4 @@ steps:
workingDirectory: $(Build.SourcesDirectory)/${{ parameters.Directory }}
filePath: eng/common/scripts/Verify-Links.ps1
arguments: >
-urls $(dir -r -i *.md) -rootUrl "file://$(Build.SourcesDirectory)/${{ parameters.Directory }}"
-urls $(dir -r -i *.md) -rootUrl "file://$(Build.SourcesDirectory)/${{ parameters.Directory }}" -recursive:$false -ignoreLinksFile ${{ parameters.IgnoreLinksFile }}
35 changes: 22 additions & 13 deletions eng/common/scripts/Verify-ChangeLog.ps1
Original file line number Diff line number Diff line change
@@ -1,38 +1,47 @@
# Wrapper Script for ChangeLog Verification
param (
[String]$ChangeLogLocation,
[String]$VersionString,
[string]$PackageName,
[string]$ServiceName,
[string]$RepoRoot,
[ValidateSet("net","java","js","python")]
[string]$Language,
[string]$RepoName,
[boolean]$ForRelease=$False
[String]$ChangeLogLocation,
[String]$VersionString,
[string]$PackageName,
[string]$ServiceName,
[string]$RepoRoot,
[ValidateSet("net", "java", "js", "python")]
[string]$Language,
[string]$RepoName,
[boolean]$ForRelease = $False
)

$ProgressPreference = "SilentlyContinue"
. (Join-Path $PSScriptRoot SemVer.ps1)
Import-Module (Join-Path $PSScriptRoot modules ChangeLog-Operations.psm1)

$validChangeLog = $false
if ($ChangeLogLocation -and $VersionString)
if ($ChangeLogLocation -and $VersionString)
{
$validChangeLog = Confirm-ChangeLogEntry -ChangeLogLocation $ChangeLogLocation -VersionString $VersionString -ForRelease $ForRelease
}
else
else
{
Import-Module (Join-Path $PSScriptRoot modules Package-Properties.psm1)
if ([System.String]::IsNullOrEmpty($Language))
{
$Language = $RepoName.Substring($RepoName.LastIndexOf('-') + 1)
if ($RepoName -match "azure-sdk-for-(?<lang>[^-]+)")
{
$Language = $matches["lang"]
}
else
{
Write-Error "Failed to set Language automatically. Please pass the appropriate Language as a parameter."
exit 1
}
}

$PackageProp = Get-PkgProperties -PackageName $PackageName -ServiceName $ServiceName -Language $Language -RepoRoot $RepoRoot
$validChangeLog = Confirm-ChangeLogEntry -ChangeLogLocation $PackageProp.pkgChangeLogPath -VersionString $PackageProp.pkgVersion -ForRelease $ForRelease
}

if (!$validChangeLog) {
if (!$validChangeLog)
{
exit 1
}

Expand Down
3 changes: 3 additions & 0 deletions eng/common/scripts/modules/Package-Properties.psm1
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,9 @@ class PackageProps
}

$ProgressPreference = "SilentlyContinue"


Register-PSRepository -Default -ErrorAction:SilentlyContinue
Install-Module -Name powershell-yaml -RequiredVersion 0.4.1 -Force -Scope CurrentUser

function Extract-PkgProps ($pkgPath, $serviceName, $pkgName, $lang)
Expand Down

0 comments on commit 8fb4e2c

Please sign in to comment.