WeBlog builds using the public Sitecore NuGet feeds, and optionally deploys to a local Sitecore instance on your machine. The Sitecore instance can be located anywhere on the local machine including in the same folder as the WeBlog source files. As WeBlog includes build configurations for several different Sitecore versions it is not possible to setup Sitecore in the same folder as the WeBlog project if you want to build against more than one Sitecore version.
If you only need to build against a single Sitecore version and like to work in the web root, then you just need to clone the WeBlog repository into your web root folder. No additional setup is required.
Perform the following before opening the solution in Visual Studio.
- Ensure you have the desired Sitecore version already installed and working on the local machine.
- Copy the
deploy.props.sample
file todeploy.props
.- The
deploy.props
file is a local only file. It's already been added to the.gitignore
file.
- The
- Edit the
deploy.props
file to update the paths to the Sitecore instances. - For each of the Sitecore versions you want to build against, update the
SitecorePath
property to reference the web root of the Sitecore instance.- Each
SitecorePath
property includes aCondition
defining which Sitecore version the property is used for.
- Each
- Open Visual Studio and select the appropriate build configuration.
- The numbers of a build configuration refers to the Sitecore version the project will be built for.
- Rebuild the solution.
- The project will automatically deploy the WeBlog files to the Sitecore instance you build against.
In addition to building the project and deploying the files, you must also restore the WeBlog Sitecore items.
- Copy the
data\serialization
folder to theApp_Data
folder of the Sitecore instance. - Access the Serialization utility page of the Sitecore instance:
/sitecore/admin/serialization.aspx
. - Select the
core
andmaster
databases. - Click the
Update {core, master} databasees
button. - Log into the Sitecore desktop.
- Perform a full publish.
The WeBlog themes use Grunt as a toolchain and are not included in the Visual Studio projects.
-
Ensure you have Node, NPM, Grunt and Bower installed. Grunt and Bower should be installed globally.
npm install -g grunt npm install -g bower
-
Execute
npm install
in thesrc/Themes
directory to restore the node packages. -
Execute
bower install
in thesrc/Themes
directory to restore the bower packages. -
Execute
grunt
in thesrc/Themes
directory to build the themes and deploy to the default (Sitecore 10.1) Sitecore instance.-
Paths for Sitecore instaces are read from the
deploy.props
file above. -
To deploy the themes to a different target instance, pass the
--scversion
parameter togrunt
:grunt --scversion=sc9.3
-
Cores must be created in Solr for the WeBlog content search indexes.
-
Open a command prompt.
-
Navigate to the Solr
bin
folder. -
Create the cores using the
solr create
command:solr create -c weblog-master solr create -c weblog-web
-
Copy the
managed-schema
file from theconf
folder of an existing Sitecore core to the folders of the cores created above. -
Update the
WeBlog.ContentSearch.Solr.Master.config
andWeBlog.ContentSearch.Solr.Web.config
files in thesrc/Sitecore.Modules.WeBlog/App_Config/Include/
folder to match the names of the cores created above. -
Deploy weblog code (rebuild the solution in VS) to ensure index configs are available.
-
Use the Sitecore control panel to populate the managed schema.
-
Rebuild the indexes.
WeBlog uses Sitecore packages. A separate package is built for each minor version of Sitecore.
Before creating the package, ensure the code has been built and deployed as per above instructions, and ensure the themes have been build as well. All unit and integration tests should be run.
To create the package, copy the WeBlog.xml
file from the data\packages
folder over to the App_Data\packages
folder of the Sitecore instance you'll be building from.