Skip to content

Commit

Permalink
Merge develop to master for milestone v0.8
Browse files Browse the repository at this point in the history
Develop to master for milestone v0.8
  • Loading branch information
Sarafian authored Feb 27, 2017
2 parents 678c1a7 + be1ebda commit 64db47c
Show file tree
Hide file tree
Showing 13 changed files with 308 additions and 16 deletions.
8 changes: 8 additions & 0 deletions CHANGELOG.Examples.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,13 @@
# Examples Change log

## pre-release v0.8

- GH-45 and GH-46: Azure file and blob storage support.

## pre-release v0.7

- Adjusted based on changes to match to match the main codebase.

## pre-release v0.7

- Adjusted based on changes to match to match the main codebase.
Expand Down
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
# Change log

## pre-release v0.8

- GH-44: ISHBootstrap is not Set-StrictMode combatible.
- GH-45 and GH-46: Azure file and blob storage support. (Requires [ISHServer](https://github.com/Sarafian/ISHServer) version 1.2)
- GH-48: Allow override of input parameters when installing content manager.

## pre-release v0.7

- Added support for AWS S3 buckets. Requires [ISHServer](https://github.com/Sarafian/ISHServer) version 1.1
Expand Down
52 changes: 51 additions & 1 deletion Examples/Cmdlets/Get-ISHBootstrapperContextSource.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,11 @@ Function Get-ISHBootstrapperContextSource
[Parameter(Mandatory=$false,ParameterSetName="FTP")]
[switch]$FTP,
[Parameter(Mandatory=$false,ParameterSetName="AWS-S3")]
[switch]$AWSS3
[switch]$AWSS3,
[Parameter(Mandatory=$false,ParameterSetName="Azure-FileStorage")]
[switch]$AzureFileStorage,
[Parameter(Mandatory=$false,ParameterSetName="Azure-BlobStorage")]
[switch]$AzureBlobStorage
)
. "$PSScriptRoot\Get-ISHBootstrapperContextValue.ps1"

Expand Down Expand Up @@ -86,6 +90,52 @@ Function Get-ISHBootstrapperContextSource
$hash.AntennaHouseLicenseKey=$awsS3Data.AntennaHouseLicenseKey
break
}
'Azure-FileStorage' {
$azureFileStorageData=Get-ISHBootstrapperContextValue -ValuePath "AzureFileStorage" -DefaultValue $null
if(-not $azureFileStorageData)
{
return
}
$hash.ShareName=$azureFileStorageData.ShareName
if($azureFileStorageData.StorageAccountName -and $azureFileStorageData.StorageAccountKey)
{
$hash.StorageAccountName=$azureFileStorageData.StorageAccountName
$hash.StorageAccountKey=$azureFileStorageData.StorageAccountKey
}
else
{
$hash.StorageAccountName=$null
$hash.StorageAccountKey=$null
}
$hash.ISHServerFolderPath=$azureFileStorageData.ISHServerFolderPath
$hash.ISHCDFolderPath=$azureFileStorageData.ISHCDFolderPath
$hash.ISHCDFileName=$azureFileStorageData.ISHCDFileName
$hash.AntennaHouseLicensePath=$azureFileStorageData.AntennaHouseLicensePath
break
}
'Azure-BlobStorage' {
$azureBlobStorageData=Get-ISHBootstrapperContextValue -ValuePath "AzureBlobStorage" -DefaultValue $null
if(-not $azureBlobStorageData)
{
return
}
$hash.ContainerName=$azureBlobStorageData.ContainerName
if($azureBlobStorageData.StorageAccountName -and $azureBlobStorageData.StorageAccountKey)
{
$hash.StorageAccountName=$azureBlobStorageData.StorageAccountName
$hash.StorageAccountKey=$azureBlobStorageData.StorageAccountKey
}
else
{
$hash.StorageAccountName=$null
$hash.StorageAccountKey=$null
}
$hash.ISHServerFolderPath=$azureBlobStorageData.ISHServerFolderPath
$hash.ISHCDFolderPath=$azureBlobStorageData.ISHCDFolderPath
$hash.ISHCDFileName=$azureBlobStorageData.ISHCDFileName
$hash.AntennaHouseLicensePath=$azureBlobStorageData.AntennaHouseLicensePath
break
}
}

New-Object -TypeName PSObject -Property $hash
Expand Down
13 changes: 12 additions & 1 deletion Examples/Copy-ISHCD.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,8 @@ $ishServerVersion=($ishVersion -split "\.")[0]
$unc=Get-ISHBootstrapperContextSource -UNC
$ftp=Get-ISHBootstrapperContextSource -FTP
$awss3=Get-ISHBootstrapperContextSource -AWSS3
$azurefilestorage=Get-ISHBootstrapperContextSource -AzureFileStorage
$azureblobstorage=Get-ISHBootstrapperContextSource -AzureBlobStorage

if($unc)
{
Expand All @@ -56,4 +58,13 @@ if($awss3)
$key="$($awss3.ISHCDFolderKey)$($awss3.ISHCDFileName)"
& $scriptsPaths\ISHServer\Copy-ISHCD.ps1 -Computer $computerName -Credential $credential -ISHServerVersion $ishServerVersion -BucketName $awss3.BucketName -Key $key -AccessKey $awss3.AccessKey -SecretKey $awss3.SecretKey
}

if($azurefilestorage)
{
$path="$($azurefilestorage.ISHCDFolderPath)$($azurefilestorage.ISHCDFileName)"
& $scriptsPaths\ISHServer\Copy-ISHCD.ps1 -Computer $computerName -Credential $credential -ISHServerVersion $ishServerVersion -ShareName $azurefilestorage.ShareName -Path $path -StorageAccountName $azurefilestorage.StorageAccountName -StorageAccountKey $azurefilestorage.StorageAccountKey
}
if($azureblobstorage)
{
$path="$($azureblobstorage.ISHCDFolderPath)$($azureblobstorage.ISHCDFileName)"
& $scriptsPaths\ISHServer\Copy-ISHCD.ps1 -Computer $computerName -Credential $credential -ISHServerVersion $ishServerVersion -ContainerName $azureblobstorage.ContainerName -BlobName $path -StorageAccountName $azureblobstorage.StorageAccountName -StorageAccountKey $azureblobstorage.StorageAccountKey
}
29 changes: 28 additions & 1 deletion Examples/Initialize-ISHServer.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,8 @@ if(-not $isSupported)
$unc=Get-ISHBootstrapperContextSource -UNC
$ftp=Get-ISHBootstrapperContextSource -FTP
$awss3=Get-ISHBootstrapperContextSource -AWSS3
$azurefilestorage=Get-ISHBootstrapperContextSource -AzureFileStorage
$azureblobstorage=Get-ISHBootstrapperContextSource -AzureBlobStorage

if($unc)
{
Expand All @@ -60,6 +62,14 @@ if($awss3)
{
& $scriptsPaths\ISHServer\Get-ISHServerPrerequisites.ps1 -Computer $computerName -Credential $credential -ISHServerVersion $ishServerVersion -BucketName $awss3.BucketName -FolderKey $awss3.ISHServerFolderKey -AccessKey $awss3.AccessKey -SecretKey $awss3.SecretKey
}
if($azurefilestorage)
{
& $scriptsPaths\ISHServer\Get-ISHServerPrerequisites.ps1 -Computer $computerName -Credential $credential -ISHServerVersion $ishServerVersion -ShareName $azurefilestorage.ShareName -FolderPath $azurefilestorage.ISHServerFolderPath -StorageAccountName $azurefilestorage.StorageAccountName -StorageAccountKey $azurefilestorage.StorageAccountKey
}
if($azureblobstorage)
{
& $scriptsPaths\ISHServer\Get-ISHServerPrerequisites.ps1 -Computer $computerName -Credential $credential -ISHServerVersion $ishServerVersion -ContainerName $azureblobstorage.ContainerName -FolderPath $azureblobstorage.ISHServerFolderPath -StorageAccountName $azureblobstorage.StorageAccountName -StorageAccountKey $azureblobstorage.StorageAccountKey
}

& $scriptsPaths\ISHServer\Install-ISHServerPrerequisites.ps1 -Computer $computerName -Credential $credential -ISHServerVersion $ishServerVersion -InstallOracle:$installOracle -InstallMSXML4:$installMSXML

Expand Down Expand Up @@ -88,7 +98,7 @@ if($computerName)
else
{
& $scriptsPaths\ISHServer\Initialize-ISHServerOSUser.ps1 -ISHServerVersion $ishServerVersion -OSUser ($osUserCredential.UserName)
Write-Warning "Cannot execute $scriptsPaths\ISHServer\Initialize-ISHServerOSUserRegion.ps1 locally."
& $scriptsPaths\ISHServer\Initialize-ISHServerOSUserRegion.ps1 -OSUserCredential $osUserCredential -ISHServerVersion $ishServerVersion
}

$webCertificate=Get-ISHBootstrapperContextValue -ValuePath "WebCertificate"
Expand Down Expand Up @@ -170,6 +180,23 @@ if($awss3)
}
}

if($azurefilestorage)
{
if($azurefilestorage.AntennaHouseLicenseKey)
{
& $scriptsPaths\ISHServer\Set-ISHAntennaHouseLicense.ps1 -Computer $computerName -Credential $credential -ISHServerVersion $ishServerVersion -ShareName $azurefilestorage.ShareName -Path $azureblobstorage.AntennaHouseLicenseKey -StorageAccountName $azurefilestorage.StorageAccountName -StorageAccountKey $azurefilestorage.StorageAccountKey
}
}

if($azureblobstorage)
{
if($azureblobstorage.AntennaHouseLicenseKey)
{
& $scriptsPaths\ISHServer\Set-ISHAntennaHouseLicense.ps1 -Computer $computerName -Credential $credential -ISHServerVersion $ishServerVersion -ContainerName $azureblobstorage.ContainerName -BlobName $azureblobstorage.AntennaHouseLicenseKey -StorageAccountName $azureblobstorage.StorageAccountName -StorageAccountKey $azureblobstorage.StorageAccountKey
}
}


if($computerName)
{
& $scriptsPaths\Helpers\Restart-Server.ps1 -Computer $computerName -Credential $credential
Expand Down
2 changes: 1 addition & 1 deletion Examples/Install-Module.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ try

$scope=Get-ISHBootstrapperContextValue -ValuePath "InstallModuleScope" -DefaultValue "AllUsers"

& $scriptsPaths\PowerShellGet\Install-Module.ps1 -Computer $computerName -Credential $credential -ModuleName @("CertificatePS","PSFTP","AWSPowerShell") -Repository PSGallery -Scope:$scope
& $scriptsPaths\PowerShellGet\Install-Module.ps1 -Computer $computerName -Credential $credential -ModuleName @("CertificatePS","PSFTP","AWSPowerShell", "Azure.Storage") -Repository PSGallery -Scope:$scope
& $scriptsPaths\PowerShellGet\Install-Module.ps1 -Computer $computerName -Credential $credential -ModuleName $ishServerModuleName -Repository $ishServerRepository -Scope:$scope
& $scriptsPaths\PowerShellGet\Install-Module.ps1 -Computer $computerName -Credential $credential -ModuleName $ishDeployModuleName -Repository $ishDeployRepository -Scope:$scope
}
Expand Down
24 changes: 24 additions & 0 deletions Source/Scripts/ISHServer/Copy-ISHCD.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,22 @@ param (
[string]$SecretKey,
[Parameter(Mandatory=$false,ParameterSetName="From AWS S3")]
[string]$SessionToken,
[Parameter(Mandatory=$true,ParameterSetName="From Azure FileStorage")]
[string]$ShareName,
[Parameter(Mandatory=$true,ParameterSetName="From Azure FileStorage")]
[ValidatePattern(".+\.[0-9]+\.0\.[0-9]+\.[0-9]+.*\.exe")]
[string]$Path,
[Parameter(Mandatory=$true,ParameterSetName="From Azure BlobStorage")]
[string]$ContainerName,
[Parameter(Mandatory=$true,ParameterSetName="From Azure BlobStorage")]
[ValidatePattern(".+\.[0-9]+\.0\.[0-9]+\.[0-9]+.*\.exe")]
[string]$BlobName,
[Parameter(Mandatory=$false,ParameterSetName="From Azure FileStorage")]
[Parameter(Mandatory=$false,ParameterSetName="From Azure BlobStorage")]
[string]$StorageAccountName,
[Parameter(Mandatory=$false,ParameterSetName="From Azure FileStorage")]
[parameter(ParameterSetName="From Azure BlobStorage")]
[string]$StorageAccountKey,
[Parameter(Mandatory=$true,ParameterSetName="From UNC")]
[string]$FilePath
)
Expand Down Expand Up @@ -83,6 +99,14 @@ try
Get-ISHCD -BucketName $BucketName -Key $Key -Expand -AccessKey $AccessKey -ProfileName $ProfileName -ProfileLocation $ProfileLocation -Region $Region -SecretKey $SecretKey -SessionToken $SessionToken
break
}
'From Azure FileStorage' {
Get-ISHCD -ShareName $ShareName -Path $Path -Expand -StorageAccountName $StorageAccountName -StorageAccountKey $StorageAccountKey
break
}
'From Azure BlobStorage' {
Get-ISHCD -ContainerName $ContainerName -BlobName $BlobName -Expand -StorageAccountName $StorageAccountName -StorageAccountKey $StorageAccountKey
break
}
'From UNC' {
if($Computer)
{
Expand Down
23 changes: 22 additions & 1 deletion Source/Scripts/ISHServer/Get-ISHServerPrerequisites.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,20 @@ param (
[Parameter(Mandatory=$false,ParameterSetName="From AWS S3")]
[string]$SecretKey,
[Parameter(Mandatory=$false,ParameterSetName="From AWS S3")]
[string]$SessionToken
[string]$SessionToken,
[Parameter(Mandatory=$true,ParameterSetName="From Azure FileStorage")]
[string]$ShareName,
[Parameter(Mandatory=$true,ParameterSetName="From Azure BlobStorage")]
[string]$ContainerName,
[Parameter(Mandatory=$true,ParameterSetName="From Azure FileStorage")]
[Parameter(Mandatory=$true,ParameterSetName="From Azure BlobStorage")]
[string]$FolderPath,
[Parameter(Mandatory=$false,ParameterSetName="From Azure FileStorage")]
[Parameter(Mandatory=$false,ParameterSetName="From Azure BlobStorage")]
[string]$StorageAccountName,
[Parameter(Mandatory=$false,ParameterSetName="From Azure FileStorage")]
[Parameter(Mandatory=$false,ParameterSetName="From Azure BlobStorage")]
[string]$StorageAccountKey
)
$cmdletsPaths="$PSScriptRoot\..\..\Cmdlets"

Expand Down Expand Up @@ -78,6 +91,14 @@ try
Get-ISHPrerequisites -BucketName $BucketName -FolderKey $FolderKey -AccessKey $AccessKey -ProfileName $ProfileName -ProfileLocation $ProfileLocation -Region $Region -SecretKey $SecretKey -SessionToken $SessionToken
break
}
'From Azure FileStorage' {
Get-ISHPrerequisites -ShareName $ShareName -FolderPath $FolderPath -StorageAccountName $StorageAccountName -StorageAccountKey $StorageAccountKey
break
}
'From Azure BlobStorage' {
Get-ISHPrerequisites -ContainerName $ContainerName -FolderPath $FolderPath -StorageAccountName $StorageAccountName -StorageAccountKey $StorageAccountKey
break
}
}


Expand Down
4 changes: 4 additions & 0 deletions Source/Scripts/ISHServer/Initialize-ISHServerOSUser.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,10 @@ try
}
$remote=Add-ModuleFromRemote -Session $session -Name $ishServerModuleName
}
else
{
$session=$null
}

Write-Progress @scriptProgress -Status "Initializing $OSUser"
Initialize-ISHUser -OSUser $OSUser
Expand Down
21 changes: 18 additions & 3 deletions Source/Scripts/ISHServer/Initialize-ISHServerOSUserRegion.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
#>

param (
[Parameter(Mandatory=$true)]
[Parameter(Mandatory=$false)]
[string]$Computer,
[Parameter(Mandatory=$true)]
[PSCredential]$OSUserCredential,
Expand Down Expand Up @@ -46,10 +46,25 @@ try
$ishServerModuleName="ISHServer.$ISHServerVersion"
$session=New-PSSession -ComputerName $Computer -Credential $OSUserCredential
$remote=Add-ModuleFromRemote -Session $session -Name $ishServerModuleName

Write-Progress @scriptProgress -Status "Initializing regional settings"
Initialize-ISHRegional
}
else
{
$session=$null

Write-Progress @scriptProgress -Status "Initializing regional settings"
# Initialize-ISHRegional needs to execute from the osuser's context.
$arguments=@(
"-Command"
"Initialize-ISHRegional"
)
$powerShellPath=& C:\Windows\System32\where.exe powershell

Start-Process -FilePath $powerShellPath -ArgumentList $arguments -Credential $OSUserCredential -LoadUserProfile -NoNewWindow -Wait
}

Write-Progress @scriptProgress -Status "Initializing regional settings"
Initialize-ISHRegional
}

finally
Expand Down
26 changes: 25 additions & 1 deletion Source/Scripts/ISHServer/Set-ISHAntennaHouseLicense.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ param (
[Parameter(Mandatory=$true,ParameterSetName="From FTP")]
[pscredential]$FTPCredential,
[Parameter(Mandatory=$true,ParameterSetName="From FTP")]
[ValidatePattern(".*AHFormatter\.lic")]
[ValidatePattern(".*AHFormatter\.lic")]
[string]$FTPPath,
[Parameter(Mandatory=$true,ParameterSetName="From AWS S3")]
[string]$BucketName,
Expand All @@ -46,6 +46,22 @@ param (
[string]$SecretKey,
[Parameter(Mandatory=$false,ParameterSetName="From AWS S3")]
[string]$SessionToken,
[Parameter(Mandatory=$true,ParameterSetName="From Azure FileStorage")]
[string]$ShareName,
[Parameter(Mandatory=$true,ParameterSetName="From Azure FileStorage")]
[ValidatePattern(".*AHFormatter\.lic")]
[string]$Path,
[Parameter(Mandatory=$true,ParameterSetName="From Azure BlobStorage")]
[string]$ContainerName,
[Parameter(Mandatory=$true,ParameterSetName="From Azure BlobStorage")]
[ValidatePattern(".*AHFormatter\.lic")]
[string]$BlobName,
[Parameter(Mandatory=$false,ParameterSetName="From Azure FileStorage")]
[Parameter(Mandatory=$false,ParameterSetName="From Azure BlobStorage")]
[string]$StorageAccountName,
[Parameter(Mandatory=$false,ParameterSetName="From Azure FileStorage")]
[parameter(ParameterSetName="From Azure BlobStorage")]
[string]$StorageAccountKey,
[Parameter(Mandatory=$true,ParameterSetName="From File")]
[string]$FilePath
)
Expand Down Expand Up @@ -83,6 +99,14 @@ try
Set-ISHToolAntennaHouseLicense -BucketName $BucketName -Key $Key -AccessKey $AccessKey -ProfileName $ProfileName -ProfileLocation $ProfileLocation -Region $Region -SecretKey $SecretKey -SessionToken $SessionToken
break
}
'From Azure FileStorage' {
Set-ISHToolAntennaHouseLicense -ShareName $ShareName -Path $Path -Expand -StorageAccountName $StorageAccountName -StorageAccountKey $StorageAccountKey
break
}
'From Azure BlobStorage' {
Set-ISHToolAntennaHouseLicense -ContainerName $ContainerName -BlobName $BlobName -Expand -StorageAccountName $StorageAccountName -StorageAccountKey $StorageAccountKey
break
}
'From File' {
$license=Get-Content -Path $FilePath
Set-ISHToolAntennaHouseLicense -Content $license
Expand Down
Loading

0 comments on commit 64db47c

Please sign in to comment.