Skip to content
Merged
Show file tree
Hide file tree
Changes from all 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
13 changes: 9 additions & 4 deletions build.proj
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,12 @@

/p:CodeSign=True;DelaySign=True
Test the code sign workflow locally.


/p:Scope
'Azure': service management
'AzureStorage': storage data plane cmdlets
'Subfolder under src\ResourceManager': An individual cmdlet module
By default, it builds all
-->

<!-- Define build properties -->
Expand All @@ -41,7 +46,8 @@
<ItemGroup>
<CmdletSolutionsToBuild Include=".\src\ResourceManager\**\*.sln;.\src\ServiceManagement\ServiceManagement.sln" Condition=" '$(Scope)' == '' "/>
<CmdletSolutionsToBuild Include=".\src\ResourceManager\$(Scope)\*.sln" Condition=" '$(Scope)' != '' and '$(Scope)' != 'ServiceManagement' "/>
<CmdletSolutionsToBuild Include=".\src\ServiceManagement\ServiceManagement.sln" Condition=" '$(Scope)' != '' and '$(Scope)' == 'ServiceManagement' "/>
<CmdletSolutionsToBuild Include=".\src\ServiceManagement\ServiceManagement.sln"
Condition=" '$(Scope)' != '' and ('$(Scope)' == 'ServiceManagement' or '$(Scope)' == 'AzureStorage') "/>
<SetupSln Include=".\setup\azurepowershell.sln" />
<SetupPowershellGetSln Include=".\setup-powershellget\powershellget.sln" />
</ItemGroup>
Expand Down Expand Up @@ -292,8 +298,7 @@
<Target Name="Publish" DependsOnTargets="Build">
<Error Condition=" '$(NuGetKey)' == '' " Text="You must provide the NuGetKey parameter to the build: /p:NuGetKey=YOUR_PUBLISHING_KEY" />
<Message Importance="high" Text="Publishing Cmdlets..." />

<Exec Command="$(PowerShellCommand) -NoLogo -NoProfile -Command &quot;. $(LibraryToolsFolder)\PublishModules.ps1 $(Configuration) $(Scope) $(NuGetKey) \&quot;$(NuGetPublishingSource)\&quot; &quot;"/>
<Exec Command="$(PowerShellCommand) -NonInteractive -NoLogo -NoProfile -Command &quot;. $(LibraryToolsFolder)\PublishModules.ps1 $(Configuration) $(Scope) $(NuGetKey) \&quot;$(NuGetPublishingSource)\&quot; &quot;"/>
</Target>

<PropertyGroup>
Expand Down
13 changes: 10 additions & 3 deletions tools/PublishModules.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ if ([string]::IsNullOrEmpty($repositoryLocation))
if ([string]::IsNullOrEmpty($scope))
{
Write-Verbose "Default scope to all"
$scope = 'all'
$scope = 'All'
}

Write-Host "Publishing $scope package(s)"
Expand All @@ -53,13 +53,20 @@ if ($repo -ne $null) {
Register-PSRepository -Name $repoName -SourceLocation $repositoryLocation -PublishLocation $repositoryLocation/package -InstallationPolicy Trusted
}

if (($scope -eq 'all') -or ($scope -eq 'servicemanagement')) {
if (($scope -eq 'All') -or ($scope -eq 'ServiceManagement')) {
$modulePath = "$packageFolder\$buildConfig\ServiceManagement\Azure"
# Publish Azure module
Write-Host "Publishing Azure module from $modulePath"
Publish-Module -Path $modulePath -NuGetApiKey $apiKey -Repository $repoName
}

if (($scope -eq 'All') -or ($scope -eq 'AzureStorage')) {
$modulePath = "$packageFolder\$buildConfig\ServiceManagement\Azure\Azure.Storage"
# Publish AzureStorage module
Write-Host "Publishing AzureStorage module from $modulePath"
Publish-Module -Path $modulePath -NuGetApiKey $apiKey -Repository $repoName
}

if ($scope -eq 'AzureRM') {
# Publish AzureRM module
$modulePath = "$PSScriptRoot\AzureRM"
Expand All @@ -70,7 +77,7 @@ if ($scope -eq 'AzureRM') {

$resourceManagerRootFolder = "$packageFolder\$buildConfig\ResourceManager\AzureResourceManager"
$resourceManagerModules = Get-ChildItem -Path $resourceManagerRootFolder -Directory
if ($scope -eq 'all') {
if ($scope -eq 'All') {
# Publish AzureRM modules
foreach ($module in $resourceManagerModules) {
$modulePath = $module.FullName
Expand Down