Skip to content

Commit f2e7e44

Browse files
author
Hovsep
committed
Merge pull request #952 from ogail/psget
Adding publish modules script
2 parents 3323d3d + 5874c2d commit f2e7e44

File tree

13 files changed

+888
-260
lines changed

13 files changed

+888
-260
lines changed

setup/azurecmdfiles.wxi

Lines changed: 781 additions & 237 deletions
Large diffs are not rendered by default.

src/Common/Storage/Azure.Storage.psd1

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -55,17 +55,17 @@ ScriptsToProcess = @()
5555

5656
# Type files (.ps1xml) to be loaded when importing this module
5757
TypesToProcess = @(
58-
'.\Microsoft.WindowsAzure.Commands.Storage.Types.ps1xml'
58+
'.\Microsoft.WindowsAzure.Commands.Storage.Types.ps1xml'
5959
)
6060

6161
# Format files (.ps1xml) to be loaded when importing this module
6262
FormatsToProcess = @(
63-
'.\Microsoft.WindowsAzure.Commands.Storage.format.ps1xml'
63+
'.\Microsoft.WindowsAzure.Commands.Storage.format.ps1xml'
6464
)
6565

6666
# Modules to import as nested modules of the module specified in ModuleToProcess
6767
NestedModules = @(
68-
'.\Microsoft.WindowsAzure.Commands.Storage.dll',
68+
'.\Microsoft.WindowsAzure.Commands.Storage.dll'
6969
)
7070

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

8080
# Aliases to export from this module
8181
AliasesToExport = @(
82-
'Get-AzureRMStorageContainerAcl',
82+
'Get-AzureRMStorageContainerAcl',
8383
'Start-CopyAzureStorageBlob',
8484
'Stop-CopyAzureStorageBlob'
8585
)

src/ResourceManager/AzureBackup/Commands.AzureBackup/Commands.AzureBackup.csproj

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
<DebugSymbols>true</DebugSymbols>
2020
<DebugType>full</DebugType>
2121
<Optimize>false</Optimize>
22-
<OutputPath>..\..\..\Package\Debug\ResourceManager\AzureResourceManager\AzureRM.AzureBackup\</OutputPath>
22+
<OutputPath>..\..\..\Package\Debug\ResourceManager\AzureResourceManager\AzureRM.Backup\</OutputPath>
2323
<DefineConstants>DEBUG;TRACE</DefineConstants>
2424
<ErrorReport>prompt</ErrorReport>
2525
<WarningLevel>4</WarningLevel>
@@ -30,7 +30,7 @@
3030
<CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
3131
</PropertyGroup>
3232
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
33-
<OutputPath>..\..\..\Package\Release\ResourceManager\AzureResourceManager\AzureRM.AzureBackup\</OutputPath>
33+
<OutputPath>..\..\..\Package\Release\ResourceManager\AzureResourceManager\AzureRM.Backup\</OutputPath>
3434
<DefineConstants>TRACE;SIGN</DefineConstants>
3535
<Optimize>true</Optimize>
3636
<DebugType>pdbonly</DebugType>
@@ -192,8 +192,8 @@
192192
<Compile Include="Properties\AssemblyInfo.cs" />
193193
</ItemGroup>
194194
<ItemGroup>
195-
<None Include="..\AzureRM.AzureBackup.psd1">
196-
<Link>AzureRM.AzureBackup.psd1</Link>
195+
<None Include="..\AzureRM.Backup.psd1">
196+
<Link>AzureRM.Backup.psd1</Link>
197197
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
198198
</None>
199199
<None Include="Microsoft.Azure.Commands.AzureBackup.dll-help.psd1" />

src/ResourceManager/AzureBatch/Commands.Batch/Commands.Batch.csproj

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
<DebugSymbols>true</DebugSymbols>
2020
<DebugType>full</DebugType>
2121
<Optimize>false</Optimize>
22-
<OutputPath>..\..\..\Package\Debug\ResourceManager\AzureResourceManager\AzureRM.AzureBatch\</OutputPath>
22+
<OutputPath>..\..\..\Package\Debug\ResourceManager\AzureResourceManager\AzureRM.Batch\</OutputPath>
2323
<DefineConstants>TRACE;DEBUG;CODE_ANALYSIS</DefineConstants>
2424
<ErrorReport>prompt</ErrorReport>
2525
<WarningLevel>4</WarningLevel>
@@ -30,7 +30,7 @@
3030
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
3131
<DebugType>pdbonly</DebugType>
3232
<Optimize>true</Optimize>
33-
<OutputPath>..\..\..\Package\Release\ResourceManager\AzureResourceManager\AzureRM.AzureBatch\</OutputPath>
33+
<OutputPath>..\..\..\Package\Release\ResourceManager\AzureResourceManager\AzureRM.Batch\</OutputPath>
3434
<DefineConstants>TRACE;SIGN</DefineConstants>
3535
<ErrorReport>prompt</ErrorReport>
3636
<WarningLevel>4</WarningLevel>

src/ResourceManager/OperationalInsights/AzureRM.OperationalInsights.psd1

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ TypesToProcess = @()
5858

5959
# Format files (.ps1xml) to be loaded when importing this module
6060
FormatsToProcess = @(
61-
'.\Microsoft.Azure.Commands.OperationalInsights.format.ps1xml'
61+
'.\Microsoft.Azure.Commands.OperationalInsights.format.ps1xml'
6262
)
6363

6464
# Modules to import as nested modules of the module specified in ModuleToProcess

src/ResourceManager/OperationalInsights/Commands.OperationalInsights/Commands.OperationalInsights.csproj

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -164,6 +164,7 @@
164164
<ItemGroup>
165165
<None Include="..\AzureRM.OperationalInsights.psd1">
166166
<Link>AzureRM.OperationalInsights.psd1</Link>
167+
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
167168
</None>
168169
<None Include="Microsoft.Azure.Commands.OperationalInsights.dll-Help.psd1" />
169170
<Content Include="Microsoft.Azure.Commands.OperationalInsights.dll-Help.xml">

src/ResourceManager/Resources/AzureRM.Resources.psd1

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ FormatsToProcess = @(
6464
# Modules to import as nested modules of the module specified in ModuleToProcess
6565
NestedModules = @(
6666
'.\Microsoft.Azure.Commands.Resources.dll',
67-
'.\Microsoft.Azure.Commands.ResourceManager.Cmdlets.dll',
67+
'.\Microsoft.Azure.Commands.ResourceManager.Cmdlets.dll'
6868
)
6969

7070
# Functions to export from this module

src/ResourceManager/Resources/Commands.Resources/AzureResourceManager.psd1

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -67,16 +67,16 @@ FormatsToProcess = @(
6767
'.\AzureRM.Profile\Microsoft.Azure.Commands.Profile.format.ps1xml',
6868
'.\AzureRM.DataFactories\Microsoft.Azure.Commands.DataFactories.format.ps1xml',
6969
'.\AzureRM.RedisCache\Microsoft.Azure.Commands.RedisCache.format.ps1xml',
70-
'.\AzureRM.AzureBatch\Microsoft.Azure.Commands.Batch.format.ps1xml',
70+
'.\AzureRM.Batch\Microsoft.Azure.Commands.Batch.format.ps1xml',
7171
'.\AzureRM.KeyVault\Microsoft.Azure.Commands.KeyVault.format.ps1xml',
7272
'.\AzureRM.StreamAnalytics\Microsoft.Azure.Commands.StreamAnalytics.format.ps1xml',
7373
'.\AzureRM.Compute\Microsoft.Azure.Commands.Compute.format.ps1xml',
7474
'.\AzureRM.Compute\Microsoft.Azure.Commands.Compute.format.generated.ps1xml',
7575
'.\AzureRM.Network\Microsoft.Azure.Commands.Network.format.ps1xml',
7676
'.\Azure.Storage\Microsoft.WindowsAzure.Commands.Storage.format.ps1xml',
77-
'.\AzureRM.StorageManagement\Microsoft.Azure.Commands.Management.Storage.format.ps1xml',
77+
'.\AzureRM.Storage\Microsoft.Azure.Commands.Management.Storage.format.ps1xml',
7878
'.\AzureRM.OperationalInsights\Microsoft.Azure.Commands.OperationalInsights.format.ps1xml',
79-
'.\AzureRM.AzureBackup\Microsoft.Azure.Commands.AzureBackup.format.ps1xml',
79+
'.\AzureRM.Backup\Microsoft.Azure.Commands.AzureBackup.format.ps1xml',
8080
'.\AzureRM.UsageAggregates\Microsoft.Azure.Commands.UsageAggregates.Format.ps1xml',
8181
'.\AzureRM.Sql\Microsoft.Azure.Commands.Sql.format.ps1xml'
8282
)
@@ -91,7 +91,7 @@ NestedModules = @(
9191
'.\AzureRM.Sql\Microsoft.Azure.Commands.Sql.dll',
9292
'.\AzureRM.DataFactories\Microsoft.Azure.Commands.DataFactories.dll',
9393
'.\AzureRM.RedisCache\Microsoft.Azure.Commands.RedisCache.dll',
94-
'.\AzureRM.AzureBatch\Microsoft.Azure.Commands.Batch.dll',
94+
'.\AzureRM.Batch\Microsoft.Azure.Commands.Batch.dll',
9595
'.\AzureRM.Dns\Microsoft.Azure.Commands.Dns.dll',
9696
'.\AzureRM.KeyVault\Microsoft.Azure.Commands.KeyVault.dll',
9797
'.\AzureRM.TrafficManager\Microsoft.Azure.Commands.TrafficManager.dll',
@@ -102,12 +102,12 @@ NestedModules = @(
102102
'.\AzureRM.Network\Microsoft.Azure.Commands.Network.dll',
103103
'.\Azure.Storage\Microsoft.WindowsAzure.Commands.Storage.dll',
104104
'.\AzureRM.ApiManagement\Microsoft.Azure.Commands.ApiManagement.dll',
105-
'.\AzureRM.StorageManagement\Microsoft.Azure.Commands.Management.Storage.dll',
105+
'.\AzureRM.Storage\Microsoft.Azure.Commands.Management.Storage.dll',
106106
'.\AzureRM.OperationalInsights\Microsoft.Azure.Commands.OperationalInsights.dll',
107107
'.\AzureRM.UsageAggregates\Microsoft.Azure.Commands.UsageAggregates.dll',
108108
'.\AzureRM.HDInsight\Microsoft.Azure.Commands.HDInsight.dll',
109109
'.\AzureRM.ApiManagement\Microsoft.Azure.Commands.ApiManagement.ServiceManagement.dll',
110-
'.\AzureRM.AzureBackup\Microsoft.Azure.Commands.AzureBackup.dll',
110+
'.\AzureRM.Backup\Microsoft.Azure.Commands.AzureBackup.dll',
111111
'.\AzureRM.SiteRecovery\Microsoft.Azure.Commands.SiteRecovery.dll'
112112
)
113113

src/ResourceManager/Storage/AzureRM.Storage.psd1

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -46,8 +46,8 @@ ProcessorArchitecture = 'None'
4646

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

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

6262
# Format files (.ps1xml) to be loaded when importing this module
6363
FormatsToProcess = @(
64-
'.\Microsoft.Azure.Commands.Management.Storage.format.ps1xml',
64+
'.\Microsoft.Azure.Commands.Management.Storage.format.ps1xml'
6565
)
6666

6767
# Modules to import as nested modules of the module specified in ModuleToProcess

src/ResourceManager/Storage/Commands.Management.Storage/Commands.Management.Storage.csproj

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
<DebugSymbols>true</DebugSymbols>
2020
<DebugType>full</DebugType>
2121
<Optimize>false</Optimize>
22-
<OutputPath>..\..\..\Package\Debug\ResourceManager\AzureResourceManager\AzureRM.StorageManagement\</OutputPath>
22+
<OutputPath>..\..\..\Package\Debug\ResourceManager\AzureResourceManager\AzureRM.Storage\</OutputPath>
2323
<DefineConstants>DEBUG;TRACE</DefineConstants>
2424
<ErrorReport>prompt</ErrorReport>
2525
<WarningLevel>4</WarningLevel>
@@ -31,7 +31,7 @@
3131
<DebugType>pdbonly</DebugType>
3232
<DefineConstants>TRACE;SIGN</DefineConstants>
3333
<Optimize>true</Optimize>
34-
<OutputPath>..\..\..\Package\Release\ResourceManager\AzureResourceManager\AzureRM.StorageManagement\</OutputPath>
34+
<OutputPath>..\..\..\Package\Release\ResourceManager\AzureResourceManager\AzureRM.Storage\</OutputPath>
3535
<DefineConstants>TRACE</DefineConstants>
3636
<CodeAnalysisLogFile>bin\Release\Microsoft.Azure.Commands.Management.Storage.dll.CodeAnalysisLog.xml</CodeAnalysisLogFile>
3737
<CodeAnalysisUseTypeNameInSuppression>true</CodeAnalysisUseTypeNameInSuppression>

tools/Installer/generate.ps1

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,17 @@
1+
# ----------------------------------------------------------------------------------
2+
#
3+
# Copyright Microsoft Corporation
4+
# Licensed under the Apache License, Version 2.0 (the "License");
5+
# you may not use this file except in compliance with the License.
6+
# You may obtain a copy of the License at
7+
# http://www.apache.org/licenses/LICENSE-2.0
8+
# Unless required by applicable law or agreed to in writing, software
9+
# distributed under the License is distributed on an "AS IS" BASIS,
10+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
11+
# See the License for the specific language governing permissions and
12+
# limitations under the License.
13+
# ----------------------------------------------------------------------------------
14+
115
param(
216
[Parameter(Mandatory = $false, Position = 0)]
317
[string] $buildConfig

tools/PublishModules.ps1

Lines changed: 69 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,69 @@
1+
# ----------------------------------------------------------------------------------
2+
#
3+
# Copyright Microsoft Corporation
4+
# Licensed under the Apache License, Version 2.0 (the "License");
5+
# you may not use this file except in compliance with the License.
6+
# You may obtain a copy of the License at
7+
# http://www.apache.org/licenses/LICENSE-2.0
8+
# Unless required by applicable law or agreed to in writing, software
9+
# distributed under the License is distributed on an "AS IS" BASIS,
10+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
11+
# See the License for the specific language governing permissions and
12+
# limitations under the License.
13+
# ----------------------------------------------------------------------------------
14+
15+
param(
16+
[Parameter(Mandatory = $false, Position = 0)]
17+
[string] $buildConfig,
18+
[Parameter(Mandatory = $false, Position = 1)]
19+
[string] $apiKey,
20+
[Parameter(Mandatory = $false, Position = 2)]
21+
[string] $repositoryLocation
22+
)
23+
24+
if ([string]::IsNullOrEmpty($buildConfig))
25+
{
26+
Write-Verbose "Setting build configuration to 'Release'"
27+
$buildConfig = 'Release'
28+
}
29+
30+
if ([string]::IsNullOrEmpty($repositoryLocation))
31+
{
32+
Write-Verbose "Setting repository location to 'http://psget/PSGallery/api/v2/'"
33+
$repositoryLocation = 'http://psget/PSGallery/api/v2/'
34+
}
35+
36+
$packageFolder = "$PSScriptRoot\..\src\Package"
37+
$scriptFolder = Split-Path -Path $MyInvocation.MyCommand.Definition -Parent
38+
. ($scriptFolder + '.\SetupEnv.ps1')
39+
40+
if (Test-Path $packageFolder) {
41+
Remove-Item -Path $packageFolder -Recurse -Force
42+
}
43+
44+
# Build the cmdlets in debug mode
45+
msbuild "$env:AzurePSRoot\build.proj" /t:"BuildDebug"
46+
47+
$repoName = $(New-Guid).ToString()
48+
Register-PSRepository -Name $repoName -SourceLocation $repositoryLocation -PublishLocation $repositoryLocation -InstallationPolicy Trusted
49+
$modulePath = "$packageFolder\$buildConfig\ServiceManagement\Azure"
50+
# Publish Azure module
51+
Write-Host "Publishing Azure module from $modulePath"
52+
Publish-Module -Path $modulePath -NuGetApiKey $apiKey -Repository $repoName
53+
Write-Host "Published Azure module"
54+
# Publish AzureRM.Profile module
55+
Write-Host "Publishing AzureRM.Profile module from $modulePath"
56+
Publish-Module -Path "$packageFolder\$buildConfig\ResourceManager\AzureResourceManager\AzureRM.Profile" -NuGetApiKey $apiKey -Repository $repoName
57+
Write-Host "Published AzureRM.Profile module"
58+
59+
# Publish AzureRM modules
60+
$resourceManagerModules = Get-ChildItem -Path "$packageFolder\$buildConfig\ResourceManager\AzureResourceManager" -Directory
61+
foreach ($module in $resourceManagerModules) {
62+
if ($module -ne "AzureRM.Profile") {
63+
$modulePath = $module.FullName
64+
Write-Host "Publishing $module module from $modulePath"
65+
Publish-Module -Path $modulePath -NuGetApiKey $apiKey -Repository $repoName
66+
Write-Host "Published $module module"
67+
}
68+
}
69+
Unregister-PSRepository -Name $repoName

0 commit comments

Comments
 (0)