Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
Sarafian authored and beutepa committed Dec 1, 2017
1 parent 1486ad7 commit 43746bf
Show file tree
Hide file tree
Showing 5 changed files with 44 additions and 42 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,10 @@
## release v1.2

- GH-53: Add support for docker container images
- GH-78: Make ContentManager2018 the primary target

Remarks:
- Moved links from https://github.com/Sarafian to https://github.com/sdl .

## release v1.1

Expand Down
14 changes: 6 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,28 +6,26 @@ Bootstrapper for [SDL Knowledge Center](https://sdl.com/xml) Content Manager dep
For those who don't like repetitive tasks, this repository is all about automating the deployment of [SDL Knowledge Center](sdl.com/xml) Content Manager.
[SDL Knowledge Center](sdl.com/xml) Content Manager is also known as with historical names ~~Trisoft~~, ~~InfoShare~~ or as we recently established **ISH**.

I initially started this codebase as my own internal automation for a lab that I use to experiment with [ISHDeploy](https://sarafian.github.io/tags/ishdeploy/).
I initially started this codebase as my own internal automation for a lab that I use to experiment with [ISHDeploy](https://sarafian.github.io/tags/#ISHDeploy).
This repository is a port of that code base combined with some effort to improve it.

# Goal
With the ISHBootstrapper the following flow gets automated for a clean/default Windows Server 2012 R2 installation
With the ISHBootstrapper the following flow gets automated for a clean/default Windows Server 2016 installation

1. Install the `PowerShellGet` powershell module to easily install modules. Windows Server 2012 R2 offers out of the box Powershell v4.0. Content Manager 12.0.* supports version v4.0.
1. Enable and configure the **WinRM** (Windows Remoting) for secure connections and `CredSSP`
1. Install Content Manager prerequisites as described in the [documentation](https://docs.sdl.com/LiveContent/web/pub.xql?action=home&pub=SDL Knowledge Center full documentation-v2&lang=en-US)
1. Install Content Manager prerequisites as described in the [documentation](https://docs.sdl.com/LiveContent/web/pub.xql?action=home&pub=SDL%20Knowledge%20Center%20full%20documentation-v3&lang=en-US)
1. Copy the deliverable of the Content Manager CD
1. Install Content Manager. One or more deployments.
1. Execute [ISHDeploy](powershellgallery.com/packages/ISHDeploy.12.0.0/) based code as configuration scripts
1. Execute [ISHDeploy](powershellgallery.com/packages/ISHDeploy.13/) based code as configuration scripts

Do all of the above with minimum manual actions and all should work locally and remotely.
At the end the dream goal is to execute a seamless update of a Content Manager deployments

**Remarks**:

- Typically a Content Manager deployment is deployed on a server already part of Active Directory.
For this reason, some remote instructions fill face the double hop limitation described in [Powershell Remoting Caveats](https://sarafian.github.io/post/powershell/powershell-remoting-caveats/) and to work around the problem sessions with `CredSSP` will be required.
For this reason, some remote instructions fill face the double hop limitation described in [Powershell Remoting Caveats](https://sarafian.github.io/2016/07/05/remoting-caveats.html) and to work around the problem sessions with `CredSSP` will be required.
- Not all modules available here will be published to PowerShell gallery. Setting up an internal nuget repository is easy. The process is described [here](https://docs.nuget.org/create/hosting-your-own-nuget-feeds).
- The code base will work against current **Knowledge Center 2016 Content Manager 12.0.0** but the code base will support future minor releases like **Knowledge Center 2016 Content Manager 12.0.1** and future major releases that is only internally available.
- To avoid revealing internal asset names some variables will not be defined in code but we'll be acquired with cmdlets such as `Get-Variable`

# Using the repository
Expand All @@ -45,4 +43,4 @@ Potential targets of a trigger can be:

# Acknowledgements

This a **personal** effort and by **no means** reflects an official deliverable for [SDL](sdl.com).
This a **personal** effort and by **no means** reflects an official deliverable for [SDL](sdl.com).
4 changes: 2 additions & 2 deletions Source/Builders/Database/Restore-MockDatabase.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -55,8 +55,8 @@ $segments=@(
$ishCDPath
"Database"
"Dump"
"SQLServer2012"
"20151116.InfoShareEmpty-12.0.0-sqlserver2012.isource.InfoShare-OasisDita.1.2.bak"
"SQLServer2014"
"20171018.ISHEmpty-13.0.0-sqlserver2014.isource.InfoShare-OasisDita.1.2.bak"
)
$infoShareBakPath=$segments -join '\'

Expand Down
32 changes: 16 additions & 16 deletions Tutorials/How to use the repository (Builders).md
Original file line number Diff line number Diff line change
Expand Up @@ -10,28 +10,28 @@ The **builders** is a collection of scripts that wrap up the rest of the reposit

## Baking

The following example bakes a **SDL Knowledge Center 2016 SP3 Content Manager** (`$ishVersion="12.0.3"`)
The following example bakes a **SDL Knowledge Center 2018 Content Manager** (`$ishVersion="13.0.0"`)

```powershell
Get-PackageProvider -Name NuGet -ForceBootstrap | Out-Null
Save-Script -Name Get-Github -Path $env:TEMP -Force
$getGitHubPath=Join-Path $env:TEMP Get-GitHub.ps1
$ishBootstrapPath=(& $getGitHubPath -User Sarafian -Repository ISHBootstrap -Expand).FullName
$ishBootstrapPath=(& $getGitHubPath -User sdl -Repository ISHBootstrap -Expand).FullName
$buildersPath="$ishBootstrapPath\Source\Builders"
$ishVersion="12.0.3"
$awsISH1203=@{
$ishVersion="13.0.0"
$awsISH1300=@{
BucketName="sct-released"
ISHServerFolder="InfoShare/12.0/PreRequisites"
ISHCDFolder="InfoShare/12.0/"
ISHCDFileName="20170125.CD.InfoShare.12.0.3725.3.Trisoft-DITA-OT.exe"
ISHServerFolder="InfoShare/13.0/PreRequisites"
ISHCDFolder="InfoShare/13.0/"
ISHCDFileName="20171110.CD.InfoShare.13.0.3510.0.Trisoft-DITA-OT.exe"
AccessKey="accesskey"
SecretKey="secretkey"
}
& $buildersPath\Default\Install-ISHBootstrapPrerequisites.ps1 -ISHVersion $ishVersion
& $buildersPath\Initialize-ISHImage.ps1 @awsISH1203 -ISHVersion $ishVersion -InformationAction Continue -ErrorAction Stop
& $buildersPath\Initialize-ISHImage.ps1 @awsISH1300 -ISHVersion $ishVersion -InformationAction Continue -ErrorAction Stop
```

## Instantiating
Expand All @@ -45,7 +45,7 @@ Set-StrictMode -Version latest
Save-Script -Name Get-Github -Path $env:TEMP -Force
$getGitHubPath=Join-Path $env:TEMP Get-GitHub.ps1
$ishBootstrapPath=(& $getGitHubPath -User Sarafian -Repository ISHBootstrap -Branch import-builders -Expand).FullName
$ishBootstrapPath=(& $getGitHubPath -User sdl -Repository ISHBootstrap -Branch import-builders -Expand).FullName
$buildersPath="$ishBootstrapPath\Source\Builders"
$osUserCredentials=New-Object System.Management.Automation.PSCredential("InfoShareServiceUser",(ConvertTo-SecureString "Password123" -AsPlainText -Force))
Expand All @@ -70,7 +70,7 @@ Use the `Invoke-PackerBuild.ps1` to start building an AMI.

```powershell
$hash=@{
ISHVersion="12.0.3"
ISHVersion="13.0.0"
IAMInstanceProfile="IAMInstanceProfile"
Region="eu-west-1"
AccessKey="AccessKey"
Expand All @@ -96,13 +96,13 @@ As part of the `userdata` or **CodeDeploy** packages, to configure the EC2 execu

When building the container, you need to specify the `ISHVersion` and amazon authorization for the S3 bucket that holds the ISHBootstrap dependencies. When building the image, there are two options depending on whether a mock connection string for a SQL Server 2014 SP2 ISH database is provided. When not provided, the container will derive from `asarafian/mssql-server-windows-express:2014SP2` and include a database.

The following example builds a **SDL Knowledge Center 2016 SP3 Content Manager** (`$ishVersion="12.0.3"`) with embedded SQL Server 2014 SP2. The image name is `asarafian/ishmssql` with tag `12.0.3`.
The following example builds a **SDL Knowledge Center 2018 Content Manager** (`$ishVersion="13.0.0"`) with embedded SQL Server 2014 SP2. The image name is `asarafian/ishmssql` with tag `13.0.0`.

```powershell
# Build container with internal SQL Server 2014 SP2
# Build container with internal SQL Server 2016
$hash=@{
ISHVersion="12.0.3"
ISHVersion="13.0.0"
AccessKey="accesskey"
SecretKey="secretkey"
}
Expand All @@ -111,13 +111,13 @@ $hash=@{
```

The following example builds a **SDL Knowledge Center 2016 SP3 Content Manager** (`$ishVersion="12.0.3"`) using an external database with connection string `connectionstring`. The image name is `asarafian/ish` with tag `12.0.3`.
The following example builds a **SDL Knowledge Center 2018 Content Manager** (`$ishVersion="13.0.0"`) using an external database with connection string `connectionstring`. The image name is `asarafian/ish` with tag `13.0.0`.

```powershell
# Build container with internal SQL Server 2014 SP2
$hash=@{
ISHVersion="12.0.3"
ISHVersion="13.0.0"
AccessKey="accesskey"
SecretKey="secretkey"
MockConnectionString="connectionstring"
Expand Down Expand Up @@ -169,7 +169,7 @@ Use the `Invoke-PackerBuild.ps1` to start building a Vagrant box.

```powershell
$hash=@{
ISHVersion="12.0.3"
ISHVersion="13.0.0"
IAMInstanceProfile="IAMInstanceProfile"
Region="eu-west-1"
AccessKey="AccessKey"
Expand Down
32 changes: 16 additions & 16 deletions Tutorials/How to use the repository (Examples).md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# How to use the repository (Examples)

Starting from a clean server operating system this how you end up with a [SDL Knowledge Center 2016](sdl.com/xml) Content Manager 12.0.1 Deployment.
Starting from a clean server operating system this how you end up with a [SDL Knowledge Center 2018](sdl.com/xml) Content Manager Deployment.

# Acknowledgements

Expand All @@ -11,8 +11,8 @@ Starting from a clean server operating system this how you end up with a [SDL Kn
- Dependency to PowerShell modules on gallery
- [CertificatePS](http://www.powershellgallery.com/packages/CertificatePS/). This is used to help with certificate templates. Read more about this [here](https://github.com/Sarafian/CertificatePS)
- [PSFTP](http://www.powershellgallery.com/packages/PSFTP/). This is used to download files from an ftp server.
- [ISHServer.12](http://www.powershellgallery.com/packages/ISHServer.12/). This is used to automate the prerequisites instalation.
- [ISHDeploy.12.0.0](http://www.powershellgallery.com/packages/ISHDeploy.12.0.0/). This is used to download files from an ftp server.
- [ISHServer.13](http://www.powershellgallery.com/packages/ISHServer.13/). This is used to automate the prerequisites instalation.
- [ISHDeploy.13](http://www.powershellgallery.com/packages/ISHDeploy.13/). This is used to download files from an ftp server.

To quickly host an internal NuGet server follow the instructions in this [article](https://docs.nuget.org/create/hosting-your-own-nuget-feeds).
Once the server is up you need to register the repository on your system while specifying the both the `-SourceLocation` and `PublishLocation` parameters.
Expand All @@ -29,10 +29,10 @@ The process depends on scripts in the examples directory. To help run these scri
1. Register a repository for `mymachine`.
1. Install all modules
1. Enable the CredSSP authentication for PSSession.
1. Install the server prerequisites using module [ISHServer.12](http://www.powershellgallery.com/packages/ISHServer.12/).
1. Install the server prerequisites using module [ISHServer.13](http://www.powershellgallery.com/packages/ISHServer.13/).
1. Seed the server with a Content Manager CD.
1. Install a deployment.
1. Apply code as configuration scripts using PowerShell module [ISHDeploy.12.0.1](www.powershellgallery.com/packages/ISHDeploy.12.0.1/). Other module variants are also possible
1. Apply code as configuration scripts using PowerShell module [ISHDeploy.13](www.powershellgallery.com/packages/ISHDeploy.13/). Other module variants are also possible
1. Run Pester tests

## Load the data container json file
Expand All @@ -43,7 +43,7 @@ The process depends on scripts in the examples directory. To help run these scri
An obfuscated file for local execution looks like this
```json
{
"ISHVersion": "12.0.1",
"ISHVersion": "13.0.0",
"ISHDeployRepository": "PSGallery",
"PSRepository": [
],
Expand All @@ -55,19 +55,19 @@ An obfuscated file for local execution looks like this
"FTP": {
"Host": "host",
"CredentialExpression": "New-Credential -Message \"FTP\"",
"ISHServerFolder": "Download/InfoShare120/ISHServer/",
"ISHCDFolder": "Download/InfoShare120/SP1/",
"ISHCDFileName": "20160815.CD.InfoShare.12.0.3215.1.Trisoft-DITA-OT.exe",
"ISHServerFolder": "Download/InfoShare130/ISHServer/",
"ISHCDFolder": "Download/InfoShare130/SP0/",
"ISHCDFileName": "20171110.CD.InfoShare.13.0.3510.0.Trisoft-DITA-OT.exe",
"AntennaHouseLicensePath": "License/AntennaHouse/AHFormatter.lic"
},
"AWSS3": {
"BucketName": "bucketname",
"ProfileName": "profilename",
"AccessKey": "accesskey",
"SecretKey": "secretkey",
"ISHServerFolderKey": "InfoShare/12.0/PreRequisites",
"ISHCDFolderKey": "InfoShare/12.0/",
"ISHCDFileName": "20160815.CD.InfoShare.12.0.3215.1.Trisoft-DITA-OT.exe",
"ISHServerFolderKey": "InfoShare/13.0/PreRequisites",
"ISHCDFolderKey": "InfoShare/13.0/",
"ISHCDFileName": "20171110.CD.InfoShare.13.0.3510.0.Trisoft-DITA-OT.exe",
"AntennaHouseLicenseKey": "Licenses/AntennaHouse/AHFormatter.lic"
},
"OSUserCredentialExpression": "New-Credential -Message \"OSUser\"",
Expand Down Expand Up @@ -130,7 +130,7 @@ Installs all required modules.
& .\Examples\Initialize-WinRM.ps1
```

The required certificate for the Secure WinRM is issued by the domain certificate authority, effectively making it a double hop. More about the issue [PowerShell Remoting Caveats](https://sarafian.github.io/post/powershell/powershell-remoting-caveats/).
The required certificate for the Secure WinRM is issued by the domain certificate authority, effectively making it a double hop. More about the issue [PowerShell Remoting Caveats](https://sarafian.github.io/2016/07/05/remoting-caveats.html).
For this script to work we need an extra fragment in the JSON

```json
Expand Down Expand Up @@ -263,9 +263,9 @@ You can trigger the sequence with
```

The above scripts are based on executing script blocks on the remote servers.
This pattern is not very friendly to the concept of code as configuration as described on [code as configuration](https://sarafian.github.io/post/code%20as%20configuration/).
This pattern is not very friendly to the concept of code as configuration as described on [code as configuration](https://sarafian.github.io/2016/05/17/code-configuration.html).
Although much of the noise is hidden away using the `Invoke-CommandWrap` which is available on [gist](https://gist.github.com/Sarafian/a277cd64468a570dff74682eb929ff3c) for some people it is not good enough.
For this reason all scripts have a sibling counterpart that uses implicit remoting as described on [import and use module from a remote server](https://sarafian.github.io/post/powershell/Import-Use-Module-Remote-Server/).
For this reason all scripts have a sibling counterpart that uses implicit remoting as described on [import and use module from a remote server]https://sarafian.github.io/tips/2016/07/01/Import-Module-Remote.html).

- `Set-ISHCMComponents.ImplicitRemoting.ps1`
- `Set-ISHCMMenuAndButton.ImplicitRemoting.ps1`
Expand All @@ -276,7 +276,7 @@ For this reason all scripts have a sibling counterpart that uses implicit remoti
All *ImplicitRemoting.ps1* variants do exactly the same thing but the code is conceptually different.
You must also watch out because the code executes also differently.
There are some important aspects of PowerShell remoting that one needs to be aware of.
Read more about it on [PowerShell remoting caveats](https://sarafian.github.io/post/powershell/powershell-remoting-caveats/) and google.
Read more about it on [PowerShell remoting caveats](https://sarafian.github.io/2016/07/05/remoting-caveats.html) and google.

> What you see is not exactly what you get!
Expand Down

0 comments on commit 43746bf

Please sign in to comment.