Skip to content

Commit 8cb0f91

Browse files
Merge pull request Sitecore#60 from AmitKumar-AK/feature/SITECORE-10-3-LTSC2022
Update for Sitecore 10.3 ltsc2019 and ltsc2022
2 parents 766f6f9 + 53697d8 commit 8cb0f91

8 files changed

Lines changed: 144 additions & 5 deletions

File tree

.gitignore

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,4 +29,7 @@ _ReSharper*/
2929
[Tt]est[Rr]esult*
3030
.vs/
3131
.vscode/
32-
packages/
32+
packages/
33+
# Device Detection Data files
34+
docker/devicedetection/*.lock
35+
docker/devicedetection/*.hash

custom-images/.env

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,4 +51,4 @@ SQL_SERVER=mssql
5151
SQL_SA_LOGIN=sa
5252
SQL_SA_PASSWORD=
5353
SQL_CUSTOM_DATABASE_PREFIX_UPDATE_FROM=
54-
SQL_DATABASE_PREFIX=Sitecore
54+
SQL_DATABASE_PREFIX=Sitecore

custom-images/README.md

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
# Sitecore Custom Images
2+
3+
Example solution for creating [custom Sitecore images](https://doc.sitecore.com/xp/en/developers/103/developer-tools/create-custom-sitecore-images.html), with recommended folder structure for container development.
4+
5+
Please follow below steps to setup this repository on your local system
6+
7+
## Steps
8+
9+
1. Clone this repo
10+
11+
2. Open the PowerShell command prompt with `ADMIN` access
12+
13+
3. Go to the folder `custom-images` in the PowerShell window
14+
15+
4. Execute the `init.ps1` with `ADMIN` access and pass the license file path
16+
17+
```powershell
18+
.\init.ps1 -LicenseXmlPath "<C:\path\to\license.xml><path to your license.xml file>"
19+
```
20+
21+
22+
5. Build the appropriate Docker images and then start up.
23+
24+
```powershell
25+
.\clean-install.ps1 <XP1 or XM1>
26+
```
27+
- `.\clean-install.ps1 XP1` will create the XP Scaled environment
28+
- `.\clean-install.ps1 XM1` will create the XM environment
29+
- `.\clean-install.ps1` will create the XP0 environment
30+
31+
The above command will create the specific Sitecore Topology environemnt.
32+
33+
6. Tear down and cleanup code changes when done.
34+
```powershell
35+
.\down.ps1 <XP1 or XM1>
36+
```
37+
- `.\down.ps1 XP1` will clear artifacts for the XP Scaled environment
38+
- `.\down.ps1 XM1` will clear artifacts for the XM environment
39+
- `.\down.ps1` will clear artifacts for the XP0 environment
40+
41+
42+
43+
44+

custom-images/clean-install.ps1

Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
param(
2+
$XM1
3+
)
4+
5+
6+
Write-Host "The purpose of this script to start setup from scratch`n" -ForegroundColor Magenta
7+
Write-Host " 1. Stop all containers`n" -ForegroundColor DarkCyan
8+
Write-Host " 2. Docker Prune -Remove all unused containers, networks, images (both dangling and unreferenced), and optionally, volumes`n" -ForegroundColor DarkCyan
9+
Write-Host " 3. Stop IIS, Stop/Start Host Network Service (HNS)`n" -ForegroundColor DarkCyan
10+
Write-Host " 4. Run .\clean.ps1 from Sitecore > Docker`n" -ForegroundColor DarkCyan
11+
Write-Host " 5. Restore Sitecore CLI Tool`n" -ForegroundColor DarkCyan
12+
Write-Host " 6. Run docker compose up command`n" -ForegroundColor DarkCyan
13+
14+
Write-Host "`n`n1. Stop all containers..." -ForegroundColor Cyan
15+
docker container stop $(docker container ls -q --filter name=docker-examples*);
16+
docker-compose stop; docker-compose down
17+
18+
Write-Host "`n`n2. Docker Prune" -ForegroundColor Cyan
19+
docker system prune
20+
docker rmi $(docker images --format "{{.Repository}}:{{.Tag}}" | findstr "docker-examples")
21+
22+
23+
if ($XM1 -ieq 'XM1') {
24+
docker rmi $(docker images --format "{{.Repository}}:{{.Tag}}" | findstr "docker-examples-xm1")
25+
}
26+
elseif ($XM1 -ieq 'XP1') {
27+
docker rmi $(docker images --format "{{.Repository}}:{{.Tag}}" | findstr "docker-examples-xp1")
28+
}
29+
else {
30+
docker rmi $(docker images --format "{{.Repository}}:{{.Tag}}" | findstr "docker-examples-xp0")
31+
}
32+
33+
Write-Host "`n`n3. Stop IIS, Stop/Start Host Network Service (HNS)" -ForegroundColor Cyan
34+
iisreset /stop; net stop hns; net start hns
35+
36+
Write-Host "`n`n4. Clean all previous build artifacts" -ForegroundColor Cyan
37+
Push-Location docker
38+
.\clean.ps1
39+
40+
Write-Host "`n`n5. Restore Sitecore CLI tool" -ForegroundColor Cyan
41+
Pop-Location
42+
dotnet tool restore
43+
44+
Write-Host "`n`n6. Build/Compose Docker" -ForegroundColor Cyan
45+
Pop-Location
46+
47+
48+
if ($XM1 -ieq 'XM1') {
49+
Write-Host "Start Up script for XM1......" -ForegroundColor Cyan
50+
docker-compose -f docker-compose.xm1.yml -f docker-compose.xm1.override.yml up -d
51+
}
52+
elseif ($XM1 -ieq 'XP1') {
53+
Write-Host "Start Up script for XP1......" -ForegroundColor Cyan
54+
docker-compose -f docker-compose.xp1.yml -f docker-compose.xp1.override.yml up -d
55+
}
56+
else {
57+
Write-Host "Start Up script for XP0......" -ForegroundColor Cyan
58+
docker-compose up -d
59+
}
60+
61+
Write-Host "***Setup completed successfully***" -ForegroundColor Green

custom-images/docker-compose.xp1.override.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ services:
1515
volumes:
1616
- ./docker/traefik:C:/etc/traefik
1717

18-
redis:
18+
redis:
1919
image: ${REGISTRY}${COMPOSE_PROJECT_NAME}-redis:${VERSION:-latest}
2020
build:
2121
context: ./docker/build/redis

custom-images/docker/data/devicedetection/.gitkeep

Whitespace-only changes.

custom-images/down.ps1

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
param(
2+
$XM1
3+
)
4+
5+
Write-Host "Down containers..." -ForegroundColor Green
6+
try {
7+
docker-compose kill mssql
8+
if ($LASTEXITCODE -ne 0) {
9+
Write-Error "Container down failed, see errors above."
10+
}
11+
12+
if ($XM1 -ieq 'XM1') {
13+
Write-Host "Down script for XM1......" -ForegroundColor Cyan
14+
docker-compose -f docker-compose.xm1.yml -f docker-compose.xm1.override.yml down
15+
16+
}
17+
elseif ($XM1 -ieq 'XP1') {
18+
Write-Host "Down script for XP1......" -ForegroundColor Cyan
19+
docker-compose -f docker-compose.xp1.yml -f docker-compose.xp1.override.yml down
20+
21+
}
22+
23+
docker-compose down
24+
if ($LASTEXITCODE -ne 0) {
25+
Write-Error "Container down failed, see errors above."
26+
}
27+
28+
29+
}
30+
finally {
31+
}

getting-started/.env

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
COMPOSE_PROJECT_NAME=sitecore-xp0
22
SITECORE_DOCKER_REGISTRY=scr.sitecore.com/sxp/
3-
SITECORE_VERSION=10.3.0-ltsc2019
3+
SITECORE_VERSION=10.3-ltsc2022
44
SITECORE_ADMIN_PASSWORD=
55
SQL_SA_PASSWORD=
66
TELERIK_ENCRYPTION_KEY=
@@ -33,4 +33,4 @@ SITECORE_GRAPHQL_ENABLED=false
3333
SITECORE_GRAPHQL_EXPOSEPLAYGROUND=false
3434

3535
LOG_LEVEL_VALUE=INFO
36-
EXTERNAL_IMAGE_TAG_SUFFIX=ltsc2019
36+
EXTERNAL_IMAGE_TAG_SUFFIX=ltsc2022

0 commit comments

Comments
 (0)