Walkthrough: Adding the SXA module
Sitecore Experience Accelerator (SXA) is a Sitecore module developed to speed up the production of websites and to reuse components, layouts, and templates across a variety of sites. To add the SXA module, you must create specific Docker images and push them to the Azure Container Registry (ACR) and then change them in the Application repository before running the SearchStax Solr and Mssql containers.
This walkthrough describes how to:
-
Prepare the Docker images
-
Push the images to the ACR
-
Change the images in the Application repository
-
Run the Searchstax-solr-init-sxa-spe-container:
-
Without disaster recovery.
-
With disaster recovery.
-
-
Run the Mssql-init-sxa-spe container:
-
Without disaster recovery.
-
With disaster recovery.
-
Prepare the Docker images
Prepare the Docker images
Refer to the Add Sitecore modules topic to learn how to create a custom SXA module.
To be able to work with SXA, you must create the following images:
-
cm-sxa-spe -
cd-sxa-spe -
Mssql-init-sxa-spe -
Searchstax-solr-init-sxa-speNoteWhen you build the solr-init image for sxa, ensure that the base image is designed for use with Searchstax. In the Sitecore image repository, these images have tags that end with
-searchstax, for example,sitecore-xp1-solr-init-searchstax.
Push the images to the Azure Container Registry
Push the images to the Azure Container Registry
To push the images to the ACR:
-
In PowerShell, execute the docker push command. You must push all images to the pre-provisioned ACR:
{infrastructure_id}acr
Change the images in the Application repository
Change the images in the Application repository
Now you can add the SXA-specific naming and the two new properties to the Application repository.
To change the images in the Application repository:
-
Navigate to the Application repository
config/docker-imagesand editdocker-images.jsonas follows:-
Replace the
cmimage withcm-sxa-spe. -
Replace the
cdimage withcd-sxa-spe. -
Add the
Mssql-init-sxa-speproperty. -
Add the
Searchstax-solr-init-sxa-speproperty.
-
Run the Searchstax-solr-init-sxa-spe container without disaster recovery
Run the Searchstax-solr-init-sxa-spe container without disaster recovery
To run the Searchstax-solr-init-sxa-spe container:
-
Navigate to
roles\sitecore-{topology}\templates\and add theSearchstax-solr-init-sxa-spejob file under the name:searchstax-solr-init-sxa-spe.yaml. For example: -
To add the Ansible tasks to run the
Searchstax-solr-init-sxa-spejob, go toroles\sitecore-{topology}\tasks\init.yamland add the following scripts at the end of the file: -
Run the application pipeline.
Run the Searchstax-solr-init-sxa-spe container with disaster recovery
Run the Searchstax-solr-init-sxa-spe container with disaster recovery
To run the Searchstax-solr-init-sxa-spe container:
-
Navigate to
roles\sitecore-{topology}\templates\and add theSearchstax-solr-init-sxa-spejob file under the name:searchstax-solr-init-sxa-spe.yaml. For example: -
Create a custom
init.yamlfile, for examplecustom-init.yaml, and put it under the following folder: /roles/sitecore-{topology}/tasks. -
To add the
Searchstax-solr-init-sxa-spejob, add the following stripts to the file: -
To call the custom
init.yamlfile, go to /roles/sitecore-{topology}/tasks/main.yaml and add the following code at the end of the file:
-
Run the application pipeline.
-
If the custom job has been successfully created, comment out the Execute custom init jobs role.
Run the Mssql-init-sxa-spe container without disaster recovery
Run the Mssql-init-sxa-spe container without disaster recovery
To run the Mssql-init-sxa-spe container:
-
Navigate to
roles\sitecore-{topology}\templates\and add themssql-init-sxa-spejob file under the name:mssql-init-sxa-spe.yaml. For example: -
To add the Ansible tasks to run the
mssql-init-sxa-spejob, go toroles\sitecore-{topology}\tasks\init.yamland add the following scripts at the end of the file: -
Run the application pipeline.
Run the Mssql-init-sxa-spe container with disaster recovery
Run the Mssql-init-sxa-spe container with disaster recovery
To run the Mssql-init-sxa-spe container:
-
Navigate to
roles\sitecore-{topology}\templates\and add themssql-init-sxa-spejob file under the name:mssql-init-sxa-spe.yaml. For example: -
Create a custom
init.yamlfile, for examplecustom-init.yaml, and put it under the /roles/sitecore-{topology}/tasks folder. -
To add the
mssql-init-sxa-spejob to the file, add the following code: -
To call the custom
init.yamlfile, go to /roles/sitecore-{topology}/tasks/main.yaml and add the following role at the end of the file:
-
Run the application pipeline.
-
If the custom job has been successfully created, comment out the Execute custom init jobs role.