Skip to content

Instantly share code, notes, and snippets.

@peplau
Last active September 9, 2023 17:06
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save peplau/d76b07774c1ee1ef3924971f8d060c50 to your computer and use it in GitHub Desktop.
Save peplau/d76b07774c1ee1ef3924971f8d060c50 to your computer and use it in GitHub Desktop.
XM Cloud local development cheat sheet
# 1. Select the Rendering Host at /sitecore/system/Settings/Services/Rendering Hosts
# 2. Create new Rendering Host eg: "Local"
# 3. Edit the Local item:
# - Server side rendering engine endpoint URL: http://rendering:3000/api/editing/render
# - Server side rendering engine application URL: http://rendering:3000
# 4. Select Site Grouping definition under YourSite/Settings/Site Grouping
# - Predefined application rendering host field: Select Local
# Setup your project .json files first
# Authorize the local project with XM Cloud
dotnet sitecore cloud login
# Get ProjectId of XM Cloud project
dotnet sitecore cloud project list
# Get EnvironmentId of XM Cloud environment
dotnet sitecore cloud environment list --project-id <project-id>
# Run the connect command to XM Cloud
dotnet sitecore cloud environment connect -id <environment-id> --allow-write true
# Run the connect command to local environment
dotnet sitecore connect --ref xmCloud --cm https://xmcloudcm.localhost --allow-write true -n local
# Run this at the folder where package.json is
npm run start:production
# One-time pretifying a file
npx prettier --write
# Setup VS Code settings - on every save, run prettier
# https://www.educative.io/answers/how-to-set-up-prettier-and-automatic-formatting-on-vs-code
# Pull serialized items from XM Cloud
dotnet sitecore ser pull -n "Dev"
# Push to local environment
dotnet sitecore ser push -n "local"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment