Skip to content

Commit

Permalink
Merged PR 1719: Add XC images and other fixes from GitHub
Browse files Browse the repository at this point in the history
- support for restore of packages not on dev.sitecore.net
- aligning compose file names with tags

SPE upgrade to 6.0
- Fix Sitecore Download Session variable issue

In line 104, string `downloadSession` is used for SessionVariable of Invoke_webRequest. But this was not assigned back to `$sitecoreDownloadSession` which is used in actual package download. Due to this receiving asp.net customerror page response
- Replaced downloadSession variable name with sitecoreDownloadSession

Removed the redundant else statements as per review feedback.

updated changelog with xp-xconnect-processingengine
  • Loading branch information
jeanfrancoislarente committed Oct 31, 2019
2 parents 4da633d + fe21e4e commit a30bbd7
Show file tree
Hide file tree
Showing 85 changed files with 3,461 additions and 100 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@

## October 2019

- [Added] Sitecore 9.2.0 XC images.
- [Added] New 9.2.0 `xp-xconnect-processingengine` images. See [#84](https://github.com/Sitecore/docker-images/issues/43). Thanks [@adoprog](https://github.com/adoprog) :+1:
- [Changed] Windows and Linux `spe` "Sitecore PowerShell Extensions" images updated to **v6.0**, indirectly *also* updating all `sxa` images. See [#84](https://github.com/Sitecore/docker-images/issues/84). Thanks [@michaellwest](https://github.com/michaellwest) :+1:
- [Changed] The `c:\tools\scripts\Watch-Directory.ps1` no longer deletes destination directories, only files. See [#89](https://github.com/Sitecore/docker-images/issues/89). Thanks [@sshushliapin](https://github.com/sshushliapin) :+1:
- [Fixed] The `c:\tools` folder was empty.
- [**Breaking**] Windows and Linux "Sitecore PowerShell Extensions" images is now correctly tagged with `spe` instead of `pse`.
- [**Breaking**] Linux variant tags aligned with Windows variant tags, variant version is not part of tag anymore, latest compatible version is always used. Old images moved to `./legacy/linux`.
Expand Down
Binary file modified IMAGES.md
Binary file not shown.
Binary file modified README.md
Binary file not shown.
2 changes: 1 addition & 1 deletion linux/9.2.0/sitecore-xm-spe-sql/build.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,6 @@
}
],
"sources": [
"Sitecore PowerShell Extensions-5.0 for 9.2.scwdp.zip"
"Sitecore.PowerShell.Extensions-6.0.scwdp.zip"
]
}
2 changes: 1 addition & 1 deletion linux/9.2.0/sitecore-xp-spe-sql/build.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,6 @@
}
],
"sources": [
"Sitecore PowerShell Extensions-5.0 for 9.2.scwdp.zip"
"Sitecore.PowerShell.Extensions-6.0.scwdp.zip"
]
}
49 changes: 30 additions & 19 deletions modules/SitecoreImageBuilder/SitecoreImageBuilder.psm1
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ function Invoke-PackageRestore
$ErrorActionPreference = "STOP"
$ProgressPreference = "SilentlyContinue"

$downloadUrl = "https://dev.sitecore.net"
$sitecoreDownloadUrl = "https://dev.sitecore.net"

# Load packages file
$packagesFile = Get-Item -Path (Join-Path $PSScriptRoot "..\..\sitecore-packages.json")
Expand All @@ -49,7 +49,7 @@ function Invoke-PackageRestore
}

# Find out which files is needed
$downloadSession = $null
$sitecoreDownloadSession = $null
$specs = Initialize-BuildSpecifications -Specifications (Get-BuildSpecifications -Path $Path -AutoGenerateWindowsVersionTags $AutoGenerateWindowsVersionTags) -InstallSourcePath $Destination -Tags $Tags -ImplicitTagsBehavior "Include" -DeprecatedTagsBehavior $DeprecatedTagsBehavior
$expected = $specs | Where-Object { $_.Include -and $_.Sources.Length -gt 0 } | Select-Object -ExpandProperty Sources -Unique

Expand Down Expand Up @@ -88,29 +88,37 @@ function Invoke-PackageRestore

if ($PSCmdlet.ShouldProcess($fileName))
{
# Login to dev.sitecore.net and save session for re-use
if ($null -eq $downloadSession)
Write-Host ("Downloading '{0}' to '{1}'..." -f $fileUrl, $filePath)

if ($fileUrl.StartsWith($sitecoreDownloadUrl))
{
Write-Verbose ("Logging in to '{0}'..." -f $downloadUrl)
# Login to dev.sitecore.net and save session for re-use
if ($null -eq $sitecoreDownloadSession)
{
Write-Verbose ("Logging in to '{0}'..." -f $sitecoreDownloadUrl)

$loginResponse = Invoke-WebRequest "https://dev.sitecore.net/api/authorization" -Method Post -Body @{
username = $SitecoreUsername
password = $SitecorePassword
rememberMe = $true
} -SessionVariable "downloadSession" -UseBasicParsing
$loginResponse = Invoke-WebRequest "https://dev.sitecore.net/api/authorization" -Method Post -Body @{
username = $SitecoreUsername
password = $SitecorePassword
rememberMe = $true
} -SessionVariable "sitecoreDownloadSession" -UseBasicParsing

if ($null -eq $loginResponse -or $loginResponse.StatusCode -ne 200 -or $loginResponse.Content -eq "false")
{
throw ("Unable to login to '{0}' with the supplied credentials." -f $downloadUrl)
if ($null -eq $loginResponse -or $loginResponse.StatusCode -ne 200 -or $loginResponse.Content -eq "false")
{
throw ("Unable to login to '{0}' with the supplied credentials." -f $sitecoreDownloadUrl)
}

Write-Verbose ("Logged in to '{0}'." -f $sitecoreDownloadUrl)
}

Write-Verbose ("Logged in to '{0}'." -f $downloadUrl)
# Download package using saved session
Invoke-WebRequest -Uri $fileUrl -OutFile $filePath -WebSession $sitecoreDownloadSession -UseBasicParsing
}
else
{
# Download package
Invoke-WebRequest -Uri $fileUrl -OutFile $filePath -UseBasicParsing
}

# Download package using saved session
Write-Host ("Downloading '{0}' to '{1}'..." -f $fileUrl, $filePath)

Invoke-WebRequest -Uri $fileUrl -OutFile $filePath -WebSession $downloadSession -UseBasicParsing
}
}

Expand Down Expand Up @@ -408,6 +416,9 @@ function Initialize-BuildSpecifications
"^sitecore-(xm|xp)-(sql|sqldev):(.*)$", # windows/linux platform
"^sitecore-(xm|xp)-(standalone|cm|cd):(.*)$" # windows platform

"^sitecore-xp-(.*):(.*)$", # build XP before XC
"^sitecore-xc-(.*):(.*)$",

"^sitecore-(xm|xp)-(spe|pse)-(sql|sqldev):(.*)$" # SPE windows/linux variants
"^sitecore-(xm|xp)-(spe|pse)-(standalone|cm|cd):(.*)$" # SPE windows variants

Expand Down
63 changes: 21 additions & 42 deletions sitecore-packages.json
Original file line number Diff line number Diff line change
Expand Up @@ -187,25 +187,17 @@
"description": "Sitecore Experience Accelerator 1.8 Update-1",
"url": "https://dev.sitecore.net/~/media/4427D574D1AA4DDFBEBEF66E4F36C782.ashx"
},
"Sitecore Experience Accelerator XM 1.8.1 rev. 190319 for 9.1.1.scwdp.zip": {
"description": "Sitecore Experience Accelerator 1.8 Update-1",
"url": "https://dev.sitecore.net/~/media/F8CFFFD23CD54178B5749B0ECACB5813.ashx"
},
"Sitecore Experience Accelerator XM 1.8.1 rev. 190319 for 9.1.1 CD.scwdp.zip": {
"description": "Sitecore Experience Accelerator 1.8 Update-1",
"url": "https://dev.sitecore.net/~/media/768039F8BCB24FB5A78AA99AD4391A20.ashx"
},
"Sitecore Experience Accelerator 1.8.1 rev. 190319 for 9.1.1.zip": {
"Sitecore Experience Accelerator 1.8.1 rev. 190319 for 9.1.1 CD.scwdp.zip": {
"description": "Sitecore Experience Accelerator 1.8 Update-1",
"url": "https://dev.sitecore.net/~/media/3E94F3558DD241D4B2DC8637D4BE184B.ashx"
"url": "https://dev.sitecore.net/~/media/E5D965AEFE7748D48C8698A3D57F0873.ashx"
},
"Sitecore Experience Accelerator 1.8.1 rev. 190319 for 9.1.1.scwdp.zip": {
"description": "Sitecore Experience Accelerator 1.8 Update-1",
"url": "https://dev.sitecore.net/~/media/3B83F33FE0B848C6AF9F3B58E4408A96.ashx"
},
"Sitecore Experience Accelerator 1.8.1 rev. 190319 for 9.1.1 CD.scwdp.zip": {
"Sitecore Experience Accelerator 1.8.1 rev. 190319 for 9.1.1.zip": {
"description": "Sitecore Experience Accelerator 1.8 Update-1",
"url": "https://dev.sitecore.net/~/media/E5D965AEFE7748D48C8698A3D57F0873.ashx"
"url": "https://dev.sitecore.net/~/media/3E94F3558DD241D4B2DC8637D4BE184B.ashx"
},
"Sitecore Experience Accelerator 1.9.0 rev. 190528 for 9.2 CD.scwdp.zip": {
"description": "Sitecore Experience Accelerator 1.9",
Expand All @@ -215,6 +207,14 @@
"description": "Sitecore Experience Accelerator 1.9",
"url": "https://dev.sitecore.net/~/media/1A7A3C021C7649C98DA83EF50E624C8E.ashx"
},
"Sitecore Experience Accelerator XM 1.8.1 rev. 190319 for 9.1.1 CD.scwdp.zip": {
"description": "Sitecore Experience Accelerator 1.8 Update-1",
"url": "https://dev.sitecore.net/~/media/768039F8BCB24FB5A78AA99AD4391A20.ashx"
},
"Sitecore Experience Accelerator XM 1.8.1 rev. 190319 for 9.1.1.scwdp.zip": {
"description": "Sitecore Experience Accelerator 1.8 Update-1",
"url": "https://dev.sitecore.net/~/media/F8CFFFD23CD54178B5749B0ECACB5813.ashx"
},
"Sitecore Experience Accelerator XM 1.9.0 rev. 190528 for 9.2 CD.scwdp.zip": {
"description": "Sitecore Experience Accelerator 1.9",
"url": "https://dev.sitecore.net/~/media/CA4C08B158E64CADAE6ACF20A2BD1331.ashx"
Expand All @@ -240,19 +240,19 @@
"url": "https://dev.sitecore.net/~/media/127032434274439DB84F8C47FCC90936.ashx"
},
"Sitecore JavaScript Services Server for Sitecore 9.2 XM 12.0.0 rev. 190522 CD.scwdp.zip": {
"description": "Sitecore JavaScript Services Server for Sitecore 9.2.0 CD",
"description": "Sitecore JavaScript Services Server CD WDP for Sitecore 9.2 XM",
"url": "https://dev.sitecore.net/~/media/AEB49B787A534166A6C7D6B377367776.ashx"
},
"Sitecore JavaScript Services Server for Sitecore 9.2 XM 12.0.0 rev. 190522.scwdp.zip": {
"description": "Sitecore JavaScript Services Server for Sitecore 9.2.0",
"description": "Sitecore JavaScript Services Server WDP for Sitecore 9.2 XM",
"url": "https://dev.sitecore.net/~/media/305523FA736948C9855A8B0539FF1680.ashx"
},
"Sitecore JavaScript Services Server for Sitecore 9.2 XP 12.0.0 rev. 190522 CD.scwdp.zip": {
"description": "Sitecore JavaScript Services Server for Sitecore 9.2.0 CD",
"description": "Sitecore JavaScript Services Server CD WDP for Sitecore 9.2 XP",
"url": "https://dev.sitecore.net/~/media/187F48001A174051A7B085377838295F.ashx"
},
"Sitecore JavaScript Services Server for Sitecore 9.2 XP 12.0.0 rev. 190522.scwdp.zip": {
"description": "Sitecore JavaScript Services Server for Sitecore9.2.0",
"description": "Sitecore JavaScript Services Server WDP for Sitecore 9.2 XP",
"url": "https://dev.sitecore.net/~/media/1D5D53DE1F4B43E8B3D70E0D0EE40A5D.ashx"
},
"Sitecore PowerShell Extensions-5.0 for 9.2.scwdp.zip": {
Expand Down Expand Up @@ -283,32 +283,11 @@
"description": "Sitecore Experience Commerce 9.1 Initial Release",
"url": "https://dev.sitecore.net/~/media/EF8EE376257142B4BDFAFF7EB1E1CA3E.ashx"
},
"Web Forms for Marketers 9.0 rev. 171003.zip": {
"description": "Web Forms for Marketers 9.0 Initial Release",
"url": "https://dev.sitecore.net/~/media/F52EE5DE56C44C0299700A46981C7AB9.ashx"
},
"Web Forms for Marketers 9.0 rev. 171209.zip": {
"description": "Web Forms for Marketers 9.0 Update-1",
"url": "https://dev.sitecore.net/~/media/26FDFBD5E8C04F41A545098F3E7DB2C6.ashx"
},
"Web Forms for Marketers 9.0 rev. 180503.zip": {
"description": "Web Forms for Marketers 9.0 Update-2",
"url": "https://dev.sitecore.net/~/media/3BFEB7C427D040178E619522EA272ECC.ashx"
},
"Sitecore JavaScript Services Server for Sitecore 9.2 XM 12.0.0 rev. 190522 CD.scwdp.zip": {
"description": "Sitecore JavaScript Services Server CD WDP for Sitecore 9.2 XM",
"url": "https://dev.sitecore.net/~/media/AEB49B787A534166A6C7D6B377367776.ashx"
},
"Sitecore JavaScript Services Server for Sitecore 9.2 XP 12.0.0 rev. 190522 CD.scwdp.zip": {
"description": "Sitecore JavaScript Services Server CD WDP for Sitecore 9.2 XP",
"url": "https://dev.sitecore.net/~/media/187F48001A174051A7B085377838295F.ashx"
"Sitecore.Commerce.WDP.2019.07-4.0.165.zip" : {
"description": "Sitecore Experience Commerce 9.2 Initial Release",
"url": "https://dev.sitecore.net/~/media/07F9ABE455944146B37E9D71CA781A27.ashx"
},
"Sitecore JavaScript Services Server for Sitecore 9.2 XM 12.0.0 rev. 190522.scwdp.zip": {
"description": "Sitecore JavaScript Services Server WDP for Sitecore 9.2 XM",
"url": "https://dev.sitecore.net/~/media/305523FA736948C9855A8B0539FF1680.ashx"
},
"Sitecore JavaScript Services Server for Sitecore 9.2 XP 12.0.0 rev. 190522.scwdp.zip": {
"description": "Sitecore JavaScript Services Server WDP for Sitecore 9.2 XP",
"url": "https://dev.sitecore.net/~/media/1D5D53DE1F4B43E8B3D70E0D0EE40A5D.ashx"
"Sitecore.PowerShell.Extensions-6.0.scwdp.zip": {
"url": "https://github.com/SitecorePowerShell/Console/releases/download/6.0/Sitecore.PowerShell.Extensions-6.0.scwdp.zip"
}
}
21 changes: 11 additions & 10 deletions windows/9.0.2/sitecore-assets/tools/scripts/Watch-Directory.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@
param(
# Path to watch for changes
[Parameter(Mandatory = $true)]
[ValidateScript( {Test-Path $_ -PathType 'Container'})]
[ValidateScript( { Test-Path $_ -PathType 'Container' })]
[string]$Path,
# Destination path to keep updated
[Parameter(Mandatory = $true)]
[ValidateScript( {Test-Path $_ -PathType 'Container'})]
[ValidateScript( { Test-Path $_ -PathType 'Container' })]
[string]$Destination,
# Milliseconds to sleep between sync operations
[Parameter(Mandatory = $false)]
Expand Down Expand Up @@ -39,9 +39,9 @@ function Sync
)

$command = @("robocopy", "`"$Path`"", "`"$Destination`"", "/E", "/XX", "/MT:1", "/NJH", "/NJS", "/FP", "/NDL", "/NP", "/NS", "/R:5", "/W:1")

if ($ExcludeDirectories.Count -gt 0)
{
{
$command += "/XD "

$ExcludeDirectories | ForEach-Object {
Expand All @@ -52,7 +52,7 @@ function Sync
}

if ($ExcludeFiles.Count -gt 0)
{
{
$command += "/XF "

$ExcludeFiles | ForEach-Object {
Expand All @@ -61,7 +61,7 @@ function Sync

$command = $command.TrimEnd()
}

$commandString = $command -join " "

$dirty = $false
Expand All @@ -72,7 +72,7 @@ function Sync

if ($dirty)
{
Write-Host ("{0}: {1}" -f [DateTime]::Now.ToString("HH:mm:ss:fff"), $line) -ForegroundColor DarkGray
Write-Host ("{0}: {1}" -f [DateTime]::Now.ToString("HH:mm:ss:fff"), $line) -ForegroundColor DarkGray
}
}

Expand Down Expand Up @@ -100,7 +100,7 @@ $watcher.EnableRaisingEvents = $true

Register-ObjectEvent $watcher Deleted -SourceIdentifier "FileDeleted" -MessageData $Destination {
$destinationPath = Join-Path $event.MessageData $eventArgs.Name
$delete = !(Test-Path $eventArgs.FullPath) -and (Test-Path $destinationPath)
$delete = !(Test-Path $eventArgs.FullPath) -and (Test-Path $destinationPath) -and !(Test-Path -Path $destinationPath -PathType "Container")

if ($delete)
{
Expand All @@ -114,6 +114,7 @@ Register-ObjectEvent $watcher Deleted -SourceIdentifier "FileDeleted" -MessageDa
{
Write-Host ("{0}: Could not delete '{1}'..." -f [DateTime]::Now.ToString("HH:mm:ss:fff"), $destinationPath) -ForegroundColor Red
}

}
} | Out-Null

Expand All @@ -129,12 +130,12 @@ try
Start-Sleep -Milliseconds $SleepMilliseconds
}
}
finally
finally
{
# Cleanup
Get-EventSubscriber -SourceIdentifier "FileDeleted" | Unregister-Event

if ($watcher -ne $null)
if ($null -ne $watcher)
{
$watcher.Dispose()
$watcher = $null
Expand Down
1 change: 1 addition & 0 deletions windows/9.1.1/sitecore-assets/build.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
"Sitecore 9.1.1 rev. 002459 (WDP XM1 packages).zip",
"Sitecore 9.1.1 rev. 002459 (WDP XP0 packages).zip",
"Sitecore 9.1.1 rev. 002459 (WDP XP1 packages).zip",
"Sitecore.Commerce.WDP.2019.07-4.0.165.zip",
"Sitecore Experience Accelerator XM 1.8.1 rev. 190319 for 9.1.1.scwdp.zip",
"Sitecore Experience Accelerator XM 1.8.1 rev. 190319 for 9.1.1 CD.scwdp.zip",
"Sitecore Experience Accelerator 1.8.1 rev. 190319 for 9.1.1.scwdp.zip",
Expand Down
21 changes: 11 additions & 10 deletions windows/9.1.1/sitecore-assets/tools/scripts/Watch-Directory.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@
param(
# Path to watch for changes
[Parameter(Mandatory = $true)]
[ValidateScript( {Test-Path $_ -PathType 'Container'})]
[ValidateScript( { Test-Path $_ -PathType 'Container' })]
[string]$Path,
# Destination path to keep updated
[Parameter(Mandatory = $true)]
[ValidateScript( {Test-Path $_ -PathType 'Container'})]
[ValidateScript( { Test-Path $_ -PathType 'Container' })]
[string]$Destination,
# Milliseconds to sleep between sync operations
[Parameter(Mandatory = $false)]
Expand Down Expand Up @@ -39,9 +39,9 @@ function Sync
)

$command = @("robocopy", "`"$Path`"", "`"$Destination`"", "/E", "/XX", "/MT:1", "/NJH", "/NJS", "/FP", "/NDL", "/NP", "/NS", "/R:5", "/W:1")

if ($ExcludeDirectories.Count -gt 0)
{
{
$command += "/XD "

$ExcludeDirectories | ForEach-Object {
Expand All @@ -52,7 +52,7 @@ function Sync
}

if ($ExcludeFiles.Count -gt 0)
{
{
$command += "/XF "

$ExcludeFiles | ForEach-Object {
Expand All @@ -61,7 +61,7 @@ function Sync

$command = $command.TrimEnd()
}

$commandString = $command -join " "

$dirty = $false
Expand All @@ -72,7 +72,7 @@ function Sync

if ($dirty)
{
Write-Host ("{0}: {1}" -f [DateTime]::Now.ToString("HH:mm:ss:fff"), $line) -ForegroundColor DarkGray
Write-Host ("{0}: {1}" -f [DateTime]::Now.ToString("HH:mm:ss:fff"), $line) -ForegroundColor DarkGray
}
}

Expand Down Expand Up @@ -100,7 +100,7 @@ $watcher.EnableRaisingEvents = $true

Register-ObjectEvent $watcher Deleted -SourceIdentifier "FileDeleted" -MessageData $Destination {
$destinationPath = Join-Path $event.MessageData $eventArgs.Name
$delete = !(Test-Path $eventArgs.FullPath) -and (Test-Path $destinationPath)
$delete = !(Test-Path $eventArgs.FullPath) -and (Test-Path $destinationPath) -and !(Test-Path -Path $destinationPath -PathType "Container")

if ($delete)
{
Expand All @@ -114,6 +114,7 @@ Register-ObjectEvent $watcher Deleted -SourceIdentifier "FileDeleted" -MessageDa
{
Write-Host ("{0}: Could not delete '{1}'..." -f [DateTime]::Now.ToString("HH:mm:ss:fff"), $destinationPath) -ForegroundColor Red
}

}
} | Out-Null

Expand All @@ -129,12 +130,12 @@ try
Start-Sleep -Milliseconds $SleepMilliseconds
}
}
finally
finally
{
# Cleanup
Get-EventSubscriber -SourceIdentifier "FileDeleted" | Unregister-Event

if ($watcher -ne $null)
if ($null -ne $watcher)
{
$watcher.Dispose()
$watcher = $null
Expand Down
Loading

0 comments on commit a30bbd7

Please sign in to comment.