Skip to content

Adding publish modules script #952

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

Merged
merged 2 commits into from
Sep 22, 2015
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
1,018 changes: 781 additions & 237 deletions setup/azurecmdfiles.wxi

Large diffs are not rendered by default.

8 changes: 4 additions & 4 deletions src/Common/Storage/Azure.Storage.psd1
Original file line number Diff line number Diff line change
Expand Up @@ -55,17 +55,17 @@ ScriptsToProcess = @()

# Type files (.ps1xml) to be loaded when importing this module
TypesToProcess = @(
'.\Microsoft.WindowsAzure.Commands.Storage.Types.ps1xml'
'.\Microsoft.WindowsAzure.Commands.Storage.Types.ps1xml'
)

# Format files (.ps1xml) to be loaded when importing this module
FormatsToProcess = @(
'.\Microsoft.WindowsAzure.Commands.Storage.format.ps1xml'
'.\Microsoft.WindowsAzure.Commands.Storage.format.ps1xml'
)

# Modules to import as nested modules of the module specified in ModuleToProcess
NestedModules = @(
'.\Microsoft.WindowsAzure.Commands.Storage.dll',
'.\Microsoft.WindowsAzure.Commands.Storage.dll'
)

# Functions to export from this module
Expand All @@ -79,7 +79,7 @@ VariablesToExport = '*'

# Aliases to export from this module
AliasesToExport = @(
'Get-AzureRMStorageContainerAcl',
'Get-AzureRMStorageContainerAcl',
'Start-CopyAzureStorageBlob',
'Stop-CopyAzureStorageBlob'
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<OutputPath>..\..\..\Package\Debug\ResourceManager\AzureResourceManager\AzureRM.AzureBackup\</OutputPath>
<OutputPath>..\..\..\Package\Debug\ResourceManager\AzureResourceManager\AzureRM.Backup\</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
Expand All @@ -30,7 +30,7 @@
<CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<OutputPath>..\..\..\Package\Release\ResourceManager\AzureResourceManager\AzureRM.AzureBackup\</OutputPath>
<OutputPath>..\..\..\Package\Release\ResourceManager\AzureResourceManager\AzureRM.Backup\</OutputPath>
<DefineConstants>TRACE;SIGN</DefineConstants>
<Optimize>true</Optimize>
<DebugType>pdbonly</DebugType>
Expand Down Expand Up @@ -192,8 +192,8 @@
<Compile Include="Properties\AssemblyInfo.cs" />
</ItemGroup>
<ItemGroup>
<None Include="..\AzureRM.AzureBackup.psd1">
<Link>AzureRM.AzureBackup.psd1</Link>
<None Include="..\AzureRM.Backup.psd1">
<Link>AzureRM.Backup.psd1</Link>
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
<None Include="Microsoft.Azure.Commands.AzureBackup.dll-help.psd1" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<OutputPath>..\..\..\Package\Debug\ResourceManager\AzureResourceManager\AzureRM.AzureBatch\</OutputPath>
<OutputPath>..\..\..\Package\Debug\ResourceManager\AzureResourceManager\AzureRM.Batch\</OutputPath>
<DefineConstants>TRACE;DEBUG;CODE_ANALYSIS</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
Expand All @@ -30,7 +30,7 @@
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<DebugType>pdbonly</DebugType>
<Optimize>true</Optimize>
<OutputPath>..\..\..\Package\Release\ResourceManager\AzureResourceManager\AzureRM.AzureBatch\</OutputPath>
<OutputPath>..\..\..\Package\Release\ResourceManager\AzureResourceManager\AzureRM.Batch\</OutputPath>
<DefineConstants>TRACE;SIGN</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ TypesToProcess = @()

# Format files (.ps1xml) to be loaded when importing this module
FormatsToProcess = @(
'.\Microsoft.Azure.Commands.OperationalInsights.format.ps1xml'
'.\Microsoft.Azure.Commands.OperationalInsights.format.ps1xml'
)

# Modules to import as nested modules of the module specified in ModuleToProcess
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -164,6 +164,7 @@
<ItemGroup>
<None Include="..\AzureRM.OperationalInsights.psd1">
<Link>AzureRM.OperationalInsights.psd1</Link>
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
<None Include="Microsoft.Azure.Commands.OperationalInsights.dll-Help.psd1" />
<Content Include="Microsoft.Azure.Commands.OperationalInsights.dll-Help.xml">
Expand Down
2 changes: 1 addition & 1 deletion src/ResourceManager/Resources/AzureRM.Resources.psd1
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ FormatsToProcess = @(
# Modules to import as nested modules of the module specified in ModuleToProcess
NestedModules = @(
'.\Microsoft.Azure.Commands.Resources.dll',
'.\Microsoft.Azure.Commands.ResourceManager.Cmdlets.dll',
'.\Microsoft.Azure.Commands.ResourceManager.Cmdlets.dll'
)

# Functions to export from this module
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -67,16 +67,16 @@ FormatsToProcess = @(
'.\AzureRM.Profile\Microsoft.Azure.Commands.Profile.format.ps1xml',
'.\AzureRM.DataFactories\Microsoft.Azure.Commands.DataFactories.format.ps1xml',
'.\AzureRM.RedisCache\Microsoft.Azure.Commands.RedisCache.format.ps1xml',
'.\AzureRM.AzureBatch\Microsoft.Azure.Commands.Batch.format.ps1xml',
'.\AzureRM.Batch\Microsoft.Azure.Commands.Batch.format.ps1xml',
'.\AzureRM.KeyVault\Microsoft.Azure.Commands.KeyVault.format.ps1xml',
'.\AzureRM.StreamAnalytics\Microsoft.Azure.Commands.StreamAnalytics.format.ps1xml',
'.\AzureRM.Compute\Microsoft.Azure.Commands.Compute.format.ps1xml',
'.\AzureRM.Compute\Microsoft.Azure.Commands.Compute.format.generated.ps1xml',
'.\AzureRM.Network\Microsoft.Azure.Commands.Network.format.ps1xml',
'.\Azure.Storage\Microsoft.WindowsAzure.Commands.Storage.format.ps1xml',
'.\AzureRM.StorageManagement\Microsoft.Azure.Commands.Management.Storage.format.ps1xml',
'.\AzureRM.Storage\Microsoft.Azure.Commands.Management.Storage.format.ps1xml',
'.\AzureRM.OperationalInsights\Microsoft.Azure.Commands.OperationalInsights.format.ps1xml',
'.\AzureRM.AzureBackup\Microsoft.Azure.Commands.AzureBackup.format.ps1xml',
'.\AzureRM.Backup\Microsoft.Azure.Commands.AzureBackup.format.ps1xml',
'.\AzureRM.UsageAggregates\Microsoft.Azure.Commands.UsageAggregates.Format.ps1xml',
'.\AzureRM.Sql\Microsoft.Azure.Commands.Sql.format.ps1xml'
)
Expand All @@ -91,7 +91,7 @@ NestedModules = @(
'.\AzureRM.Sql\Microsoft.Azure.Commands.Sql.dll',
'.\AzureRM.DataFactories\Microsoft.Azure.Commands.DataFactories.dll',
'.\AzureRM.RedisCache\Microsoft.Azure.Commands.RedisCache.dll',
'.\AzureRM.AzureBatch\Microsoft.Azure.Commands.Batch.dll',
'.\AzureRM.Batch\Microsoft.Azure.Commands.Batch.dll',
'.\AzureRM.Dns\Microsoft.Azure.Commands.Dns.dll',
'.\AzureRM.KeyVault\Microsoft.Azure.Commands.KeyVault.dll',
'.\AzureRM.TrafficManager\Microsoft.Azure.Commands.TrafficManager.dll',
Expand All @@ -102,12 +102,12 @@ NestedModules = @(
'.\AzureRM.Network\Microsoft.Azure.Commands.Network.dll',
'.\Azure.Storage\Microsoft.WindowsAzure.Commands.Storage.dll',
'.\AzureRM.ApiManagement\Microsoft.Azure.Commands.ApiManagement.dll',
'.\AzureRM.StorageManagement\Microsoft.Azure.Commands.Management.Storage.dll',
'.\AzureRM.Storage\Microsoft.Azure.Commands.Management.Storage.dll',
'.\AzureRM.OperationalInsights\Microsoft.Azure.Commands.OperationalInsights.dll',
'.\AzureRM.UsageAggregates\Microsoft.Azure.Commands.UsageAggregates.dll',
'.\AzureRM.HDInsight\Microsoft.Azure.Commands.HDInsight.dll',
'.\AzureRM.ApiManagement\Microsoft.Azure.Commands.ApiManagement.ServiceManagement.dll',
'.\AzureRM.AzureBackup\Microsoft.Azure.Commands.AzureBackup.dll',
'.\AzureRM.Backup\Microsoft.Azure.Commands.AzureBackup.dll',
'.\AzureRM.SiteRecovery\Microsoft.Azure.Commands.SiteRecovery.dll'
)

Expand Down
6 changes: 3 additions & 3 deletions src/ResourceManager/Storage/AzureRM.Storage.psd1
Original file line number Diff line number Diff line change
Expand Up @@ -46,8 +46,8 @@ ProcessorArchitecture = 'None'

# Modules that must be imported into the global environment prior to importing this module
RequiredModules = @(
@{ ModuleName = 'AzureRM.Profile'; ModuleVersion = '0.9.8' },
@{ ModuleName = 'Azure.Storage'; ModuleVersion = '0.9.8' }
@{ ModuleName = 'AzureRM.Profile'; ModuleVersion = '0.9.8' },
@{ ModuleName = 'Azure.Storage'; ModuleVersion = '0.9.8' }
)

# Assemblies that must be loaded prior to importing this module
Expand All @@ -61,7 +61,7 @@ TypesToProcess = @()

# Format files (.ps1xml) to be loaded when importing this module
FormatsToProcess = @(
'.\Microsoft.Azure.Commands.Management.Storage.format.ps1xml',
'.\Microsoft.Azure.Commands.Management.Storage.format.ps1xml'
)

# Modules to import as nested modules of the module specified in ModuleToProcess
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<OutputPath>..\..\..\Package\Debug\ResourceManager\AzureResourceManager\AzureRM.StorageManagement\</OutputPath>
<OutputPath>..\..\..\Package\Debug\ResourceManager\AzureResourceManager\AzureRM.Storage\</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
Expand All @@ -31,7 +31,7 @@
<DebugType>pdbonly</DebugType>
<DefineConstants>TRACE;SIGN</DefineConstants>
<Optimize>true</Optimize>
<OutputPath>..\..\..\Package\Release\ResourceManager\AzureResourceManager\AzureRM.StorageManagement\</OutputPath>
<OutputPath>..\..\..\Package\Release\ResourceManager\AzureResourceManager\AzureRM.Storage\</OutputPath>
<DefineConstants>TRACE</DefineConstants>
<CodeAnalysisLogFile>bin\Release\Microsoft.Azure.Commands.Management.Storage.dll.CodeAnalysisLog.xml</CodeAnalysisLogFile>
<CodeAnalysisUseTypeNameInSuppression>true</CodeAnalysisUseTypeNameInSuppression>
Expand Down
14 changes: 14 additions & 0 deletions tools/Installer/generate.ps1
Original file line number Diff line number Diff line change
@@ -1,3 +1,17 @@
# ----------------------------------------------------------------------------------
#
# Copyright Microsoft Corporation
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
# http://www.apache.org/licenses/LICENSE-2.0
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
# ----------------------------------------------------------------------------------

param(
[Parameter(Mandatory = $false, Position = 0)]
[string] $buildConfig
Expand Down
69 changes: 69 additions & 0 deletions tools/PublishModules.ps1
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
# ----------------------------------------------------------------------------------
#
# Copyright Microsoft Corporation
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
# http://www.apache.org/licenses/LICENSE-2.0
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
# ----------------------------------------------------------------------------------

param(
[Parameter(Mandatory = $false, Position = 0)]
[string] $buildConfig,
[Parameter(Mandatory = $false, Position = 1)]
[string] $apiKey,
[Parameter(Mandatory = $false, Position = 2)]
[string] $repositoryLocation
)

if ([string]::IsNullOrEmpty($buildConfig))
{
Write-Verbose "Setting build configuration to 'Release'"
$buildConfig = 'Release'
}

if ([string]::IsNullOrEmpty($repositoryLocation))
{
Write-Verbose "Setting repository location to 'http://psget/PSGallery/api/v2/'"
$repositoryLocation = 'http://psget/PSGallery/api/v2/'
}

$packageFolder = "$PSScriptRoot\..\src\Package"
$scriptFolder = Split-Path -Path $MyInvocation.MyCommand.Definition -Parent
. ($scriptFolder + '.\SetupEnv.ps1')

if (Test-Path $packageFolder) {
Remove-Item -Path $packageFolder -Recurse -Force
}

# Build the cmdlets in debug mode
msbuild "$env:AzurePSRoot\build.proj" /t:"BuildDebug"

$repoName = $(New-Guid).ToString()
Register-PSRepository -Name $repoName -SourceLocation $repositoryLocation -PublishLocation $repositoryLocation -InstallationPolicy Trusted
$modulePath = "$packageFolder\$buildConfig\ServiceManagement\Azure"
# Publish Azure module
Write-Host "Publishing Azure module from $modulePath"
Publish-Module -Path $modulePath -NuGetApiKey $apiKey -Repository $repoName
Write-Host "Published Azure module"
# Publish AzureRM.Profile module
Write-Host "Publishing AzureRM.Profile module from $modulePath"
Publish-Module -Path "$packageFolder\$buildConfig\ResourceManager\AzureResourceManager\AzureRM.Profile" -NuGetApiKey $apiKey -Repository $repoName
Write-Host "Published AzureRM.Profile module"

# Publish AzureRM modules
$resourceManagerModules = Get-ChildItem -Path "$packageFolder\$buildConfig\ResourceManager\AzureResourceManager" -Directory
foreach ($module in $resourceManagerModules) {
if ($module -ne "AzureRM.Profile") {
$modulePath = $module.FullName
Write-Host "Publishing $module module from $modulePath"
Publish-Module -Path $modulePath -NuGetApiKey $apiKey -Repository $repoName
Write-Host "Published $module module"
}
}
Unregister-PSRepository -Name $repoName