Install the EpiServer.Templates package globally
dotnet new install EPiServer.TemplatesThen install the optional EpiServer CLI tools
dotnet tool install Episerver.Net.CLI -g --add-source https://nuget.optimizely.com/feed/packages.svc/| using GraphQL.Types; | |
| using Newtonsoft.Json; | |
| using Sitecore.Configuration; | |
| using Sitecore.Data.Items; | |
| using Sitecore.Data.Fields; | |
| using Sitecore.Diagnostics; | |
| using Sitecore.LayoutService.Serialization.FieldSerializers; | |
| using Sitecore.LayoutService.Serialization.ItemSerializers; | |
| using Sitecore.LayoutService.Serialization.Pipelines.GetFieldSerializer; | |
| using Sitecore.Services.GraphQL.Content.GraphTypes; |
| #!/bin/sh | |
| # Pre-commit Git hook | |
| # It runs Sitecore CLI Serialization check | |
| # And doesn't allow to perform commit if serialization is broken | |
| validate=$(dotnet sitecore ser validate) | |
| regex_errors="Errors were detected" | |
| count=$(echo "${validate}" | grep -c "${regex_errors}") | |
| if test $count -gt 0 | |
| then | |
| echo "Sitecore serialization errors were detected" |
| $containers = docker ps -a --format "table {{.Names}}" | |
| $container = $containers | ConvertFrom-Csv | Where-Object { $_.NAMES -match "-cm" } | Select-Object -First 1 -ExpandProperty NAMES | |
| docker exec $container curl http://cm |
Install the EpiServer.Templates package globally
dotnet new install EPiServer.TemplatesThen install the optional EpiServer CLI tools
dotnet tool install Episerver.Net.CLI -g --add-source https://nuget.optimizely.com/feed/packages.svc/