Skip to content

Decoupling Azurestack admin from AzureRM.psd1 #3189

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

Closed
wants to merge 4 commits into from
Closed
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
2 changes: 0 additions & 2 deletions tools/AzureRM/AzureRM.psd1
Original file line number Diff line number Diff line change
Expand Up @@ -53,8 +53,6 @@ RequiredModules = @(@{ModuleName="AzureRM.Profile"; RequiredVersion="1.0.4.1"},
@{ModuleName="AzureRM.ApiManagement"; RequiredVersion="1.0.4.1"},
@{ModuleName="AzureRM.Automation"; RequiredVersion="1.0.4.1"},
@{ModuleName="AzureRM.Automation"; RequiredVersion="1.0.4.1"},
@{ModuleName="AzureRM.AzureStackAdmin"; RequiredVersion="0.9.11"},
@{ModuleName="AzureRM.AzureStackStorage"; RequiredVersion="0.10.1"},
@{ModuleName="AzureRM.Batch"; RequiredVersion="1.0.4.1"},
@{ModuleName="AzureRM.Compute"; RequiredVersion="1.2.2.1"},
@{ModuleName="AzureRM.DataFactories"; RequiredVersion="1.0.4.1"},
Expand Down
129 changes: 129 additions & 0 deletions tools/AzureStack/AzureStack.psd1
Original file line number Diff line number Diff line change
@@ -0,0 +1,129 @@
#
# Module manifest for module 'PSGet_AzureStack'
#
# Generated by: Microsoft Corporation
#
# Generated on: 11/14/2016
#

@{

# Script module or binary module file associated with this manifest.
# RootModule = ''

# Version number of this module.
ModuleVersion = '1.2.7'

# ID used to uniquely identify this module
GUID = '65f1e943-5e22-4b21-8350-82c798c958d2'

# Author of this module
Author = 'Microsoft Corporation'

# Company or vendor of this module
CompanyName = 'Microsoft Corporation'

# Copyright statement for this module
Copyright = 'Microsoft Corporation. All rights reserved.'

# Description of the functionality provided by this module
Description = 'Azure Stack Adminisitration Module'

# Minimum version of the Windows PowerShell engine required by this module
PowerShellVersion = '3.0'

# Name of the Windows PowerShell host required by this module
# PowerShellHostName = ''

# Minimum version of the Windows PowerShell host required by this module
# PowerShellHostVersion = ''

# Minimum version of Microsoft .NET Framework required by this module
DotNetFrameworkVersion = '4.0'

# Minimum version of the common language runtime (CLR) required by this module
CLRVersion = '4.0'

# Processor architecture (None, X86, Amd64) required by this module
# ProcessorArchitecture = ''

# Modules that must be imported into the global environment prior to importing this module
RequiredModules = @(@{ModuleName = 'AzureRM.Profile'; RequiredVersion = '1.0.4.1'; },
@{ModuleName = 'AzureRM.AzureStackAdmin'; RequiredVersion = '0.9.11'; },
@{ModuleName = 'AzureRM.AzureStackStorage'; RequiredVersion = '0.10.1'; })

# Assemblies that must be loaded prior to importing this module
# RequiredAssemblies = @()

# Script files (.ps1) that are run in the caller's environment prior to importing this module.
# ScriptsToProcess = @()

# Type files (.ps1xml) to be loaded when importing this module
# TypesToProcess = @()

# Format files (.ps1xml) to be loaded when importing this module
# FormatsToProcess = @()

# Modules to import as nested modules of the module specified in RootModule/ModuleToProcess
# NestedModules = @()

# Functions to export from this module
# FunctionsToExport = @()

# Cmdlets to export from this module
# CmdletsToExport = @()

# Variables to export from this module
# VariablesToExport = @()

# Aliases to export from this module
# AliasesToExport = @()

# DSC resources to export from this module
# DscResourcesToExport = @()

# List of all modules packaged with this module
# ModuleList = @()

# List of all files packaged with this module
# FileList = @()

# Private data to pass to the module specified in RootModule/ModuleToProcess. This may also contain a PSData hashtable with additional module metadata used by PowerShell.
PrivateData = @{

PSData = @{

# Tags applied to this module. These help with module discovery in online galleries.
# Tags = @()

# A URL to the license for this module.
LicenseUri = 'https://raw.githubusercontent.com/Azure/azure-powershell/stack-dev/LICENSE.txt'

# A URL to the main website for this project.
ProjectUri = 'https://github.com/Azure/azure-powershell'

# A URL to an icon representing this module.
# IconUri = ''

# ReleaseNotes of this module
ReleaseNotes = '2016.11.11 - Version 1.2.7
* AzureStackAdmin
* The Add-AzureRmResourceProviderRegistration changes for accepting the return code of 202 Accepted for the PUT manifest call
- Fix the issue of ProvisioningState and ExtensionName not getting populated with correct values
- Fix the issue of missing dependency dll Microsoft.Azure.Common.NetFramework.dll'

# External dependent modules of this module
# ExternalModuleDependencies = ''

} # End of PSData hashtable

} # End of PrivateData hashtable

# HelpInfo URI of this module
# HelpInfoURI = ''

# Default prefix for commands exported from this module. Override the default prefix using Import-Module -Prefix.
# DefaultCommandPrefix = ''

}

Binary file added tools/AzureStack/AzureStack.psm1
Binary file not shown.
13 changes: 9 additions & 4 deletions tools/PublishModules.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ function Get-TargetModules
$targets += $module.FullName
}
}
} elseif (($Scope -ne 'AzureRM') -and ($Scope -ne "ServiceManagement") -and ($Scope -ne "AzureStorage")) {
} elseif (($Scope -ne 'AzureRM') -and ($Scope -ne "ServiceManagement") -and ($Scope -ne "AzureStorage") -and ($Scope -ne "AzureStack")) {
$modulePath = Join-Path $resourceManagerRootFolder "AzureRM.$scope"
if (Test-Path $modulePath) {
$targets += $modulePath
Expand All @@ -75,6 +75,11 @@ function Get-TargetModules
$targets += "$PSScriptRoot\AzureRM"
}

if (($Scope -eq 'All') -or ($Scope -eq 'AzureStack')) {
# Publish AzureStack module
$targets += "$PSScriptRoot\AzureStack"
}

Write-Output -InputObject $targets
}
}
Expand Down Expand Up @@ -174,10 +179,10 @@ function Change-RMModule
Write-Output "Expanding $zipPath"
Expand-Archive $zipPath
Write-Output "Adding PSM1 dependency to $unzippedManifest"
Add-PSM1Dependency -Path $unzippedManifest
Add-PSM1Dependency -Path $unzippedManifest
Write-Output "Removing module manifest dependencies for $unzippedManifest"
Remove-ModuleDependencies -Path $unzippedManifest

Remove-ModuleDependencies -Path $unzippedManifest
Remove-Item -Path $zipPath -Force
Write-Output "Compressing $zipPath"
Compress-Archive (Join-Path -Path $dirPath -ChildPath "*") -DestinationPath $zipPath
Expand Down
28 changes: 18 additions & 10 deletions tools/UpdateModules.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,14 @@
# 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] $scope
)

function Create-ModulePsm1
{
[CmdletBinding()]
Expand Down Expand Up @@ -44,13 +52,6 @@ function Create-ModulePsm1
}
}

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

if ([string]::IsNullOrEmpty($buildConfig))
{
Write-Verbose "Setting build configuration to 'Release'"
Expand All @@ -67,8 +68,6 @@ Write-Host "Updating $scope package(and its dependencies)"

$packageFolder = "$PSScriptRoot\..\src\Package"



$resourceManagerRootFolder = "$packageFolder\$buildConfig\ResourceManager\AzureResourceManager"
$publishToLocal = test-path $repositoryLocation
$templateLocation = "$PSScriptRoot\AzureRM.Example.psm1"
Expand Down Expand Up @@ -105,7 +104,7 @@ if ($scope -eq 'All') {
Write-Host "Updated $module module"
}
}
} elseif ($scope -ne 'AzureRM') {
} elseif ($scope -ne 'AzureRM' -and $scope -ne 'AzureStack') {
$modulePath = Join-Path $resourceManagerRootFolder "AzureRM.$scope"
if (Test-Path $modulePath) {
Write-Host "Updating $scope module from $modulePath"
Expand All @@ -123,3 +122,12 @@ if (($scope -eq 'All') -or ($scope -eq 'AzureRM')) {
Create-ModulePsm1 -ModulePath $modulePath -TemplatePath $templateLocation
Write-Host "Updated Azure module"
}

if ($scope -eq 'AzureStack') {
# Update AzureStack module
$modulePath = "$PSScriptRoot\AzureStack"
Write-Host "Updating AzureStack module from $modulePath"
Create-ModulePsm1 -ModulePath $modulePath -TemplatePath $templateLocation
Write-Host "Updated AzureStack module"
}