1+
2+ <#
3+ . SYNOPSIS
4+ Script to handle the auto creation of a Docker Asset Image for a given Sitecore module
5+ . DESCRIPTION
6+ The purpose of this script is to create a Docker asset image for your Sitecore module
7+ The script is intended to automate some steps that need to be taken in order to create a custom
8+ Docker Asset Image for your Sitecore module
9+
10+ I got the inspiration for this project after reading the following blogposts:
11+
12+ How to create a Docker asset image for your Sitecore Module - Árvai Mihály
13+ https://medium.com/@mitya_1988/how-to-create-a-docker-asset-image-for-your-sitecore-module-58e1f3a47672
14+
15+ Creating a Docker Asset Image for Your Sitecore Module and Adding It To Your Site - Erica Stockwell-Alpert
16+ https://ericastockwellalpert.wordpress.com/2021/02/23/creating-a-docker-asset-image-for-your-sitecore-module-and-adding-it-to-your-site/
17+ . NOTES
18+ Version: 1.0
19+ Author: Robbert Hock - Kayee - Sitecore MVP 2010-2021
20+ Creation Date: June/July 2021
21+ Purpose/Change: Initial script development
22+ #>
23+
24+ using module " .\logo.psm1"
25+
26+ # ---------------------------------[Parameters]--------------------------------------------------------
27+ param (
28+ [string ] $ModulePackageName = " Gutters.for.Sitecore.Data.Exchange.Framework-Sitecore.10.1.0.for.DEF.5.0.0.zip"
29+ )
30+
31+ # ---------------------------------[Read configuration]------------------------------------------------
32+ $configurationPath = " configuration.json"
33+ $jsonConfiguration = Get-Content - Path $configurationPath | ConvertFrom-Json
34+ $satUrl = $jsonConfiguration.Parameters.SitecoreAzureToolkitUrl.DefaultValue
35+ $satPackageName = $jsonConfiguration.Parameters.SitecoreAzureToolkitPackageName.DefaultValue
36+
37+ Show-Start
38+
39+ Write-Host " ================================================================================================================================="
40+ Write-Host " `n "
41+ Write-Host " START - [Sitecore Azure Toolkit download]"
42+ Write-Host " `n "
43+
44+ $satDirecory = $PSScriptRoot + " \SAT"
45+
46+ if (Test-Path - Path " $satDirecory \$satPackageName " ) {
47+ Write-Host " SKIPPING - $satDirecory folder already contains the $satPackageName file"
48+ }
49+ else {
50+ Write-Host " START - downloading the $satPackageName file from dev.sitecore.net"
51+ Invoke-WebRequest - Uri $satUrl - OutFile " $satDirecory \$satPackageName "
52+ }
53+
54+ Write-Host " `n "
55+
56+ Write-Host " =================================================================================================================================="
57+ Write-Host " `n "
58+ Write-Host " START - [Sitecore Azure Toolkit extract]"
59+ Write-Host " `n "
60+
61+
62+
63+ if (-not (Test-Path " .\SAT\tools\Sitecore.Cloud.Cmdlets.dll" )) {
64+ Expand-Archive - Path " $satDirecory \$satPackageName " - DestinationPath " $satDirecory " - Force
65+ Write-Host " SUCCESS - Extracted $satPackageName to the $satDirecory directory:"
66+ Write-Host " `n "
67+ }
68+ else {
69+ Write-Host " SKIPPING - $satPackageName is already extracted to the $satDirecory directory"
70+ Write-Host " `n "
71+ }
72+
73+ Write-Host " =================================================================================================================================="
74+ Write-Host " `n "
75+ Write-Host " START - [Convert Sitecore Module to .scwdp]"
76+ Write-Host " `n "
77+
78+ $packagePath = $PSScriptRoot + " \Package\$ModulePackageName "
79+ $destinationPath = $PSScriptRoot + " \scwpd"
80+
81+ Import-Module .\SAT\tools\Sitecore.Cloud.Cmdlets.psm1
82+ Import-Module .\SAT\tools\Sitecore.Cloud.Cmdlets.dll
83+
84+ $scwdpPath = ConvertTo-SCModuleWebDeployPackage - Path $packagePath - Destination $destinationPath - Force
85+ Write-Host " SUCCESS - Your Sitecore Module was converted to a Sitecore WebDeploy package and is located at:"
86+ Write-Host " `n "
87+ Write-Host " $scwdpPath " - ForegroundColor Yellow
88+ Write-Host " `n "
89+
90+ Write-Host " =================================================================================================================================="
91+ Write-Host " `n "
92+
93+ Show-Stop
0 commit comments