01 Getting Started

Martin-Miles edited this page Jan 25, 2017 · 42 revisions

Please note that the project assumes the following settings:

Source location: C:\projects\Habitat\
Website location: C:\websites\Habitat.dev.local\
Website URL: http://habitat.dev.local/

To change these settings see the "Configuring your settings" below

Prerequisites

Important!: Always run your Visual Studio or Command Line with elevated privileges or As Administrator

Please check the Resources page for the tools needed

To install:

  1. Clone this repository to your local file system.
  2. (optional) Configure your settings if you are using settings other than the defaults:
    • The default settings for Habitat are
    • To change the standard location of the source files, website files and website URL, modify the following files:
      • Please be aware to include or omit trailing slashes - as per the default
      • /Solution Items/src/Project/Habitat/code/App_Config/Include/Project/z.Habitat.DevSettings.config
      • /Solution Items/gulp-config.js
      • /Solution Items/publishsettings.targets
  3. Set up a clean Sitecore install with the settings from the previous step
    • We recommend using Sitecore Instance Manager for the install.
    • Please note that the Sitecore executable installer does not support periods in the domain name and therefore if you are installing using this, please change the default domain (see step 2).
    • Habitat requires:
  4. Restore Node.js modules
    • Make sure you have version 4+ of node.js Download here
    • In an elevated command window run 'npm install' in the root of repository.
  5. Build and publish the solution
    • Open an command window with elevated privileges and run 'gulp' in the root of repository.
    • Alternatively:
      • Open Visual Studio 2015 in Administrator Mode
      • Open the Visual Studio 2015 Task Runner Explorer pane (View | Other Windows | Task Runner Explorer).
      • Switch to "Solution 'Habitat'"
      • Run the "default" task

Gulp

The project is configured to run Gulp through the command line or using the Task Runner Explorer pane in Visual Studio 2015.

In the initial installation running the default task will execute all the configuration and building tasks for the solution. If for some reason setup fails, it is possible to run the install tasks one by one:

  • 01-Copy-Sitecore-Lib will copy the assemblies from the Sitecore website to the solution
  • 02-Nuget-Restore restores the nuGet packages used by all projects in the solution
  • 03-Publish-All-Projects builds and publishes all the Visual Studio projects to the Sitecore website in the right order
  • 04-Apply-Xml-Transform makes the needed changes to the web.config in the Sitecore website
  • 05-Sync-Unicorn runs a complete synchronization of Unicorn for all projects in the right order

Helper tasks

  • The Auto-Publish-[...] tasks help by automatically publishing files when they are changed.
    • The Auto-Publish-Css automatically publishes .css files when changed (Configure Sass compilation in Visual Studio)
    • The Auto-Publish-Assemblies task publishes assemblies as they are built using the standard Visual Studio build process
    • The Auto-Publish-Views task publishes .cshtml files when they are changed.
  • The Publish-[...] tasks helps you by manually publishing different types of files or project types to your website.

SMTP Settings:

Habitat project uses the default Sitecore helpers to send emails. For this to work, you need to set the SMTP settings in Sitecore.config.

NOTE: If you are planning to use secure connections with your SMTP server you need to add following section to your web.config

<system.net>
 <mailSettings>
   <smtp deliveryMethod="Network">
     <network enableSsl="true" />
   </smtp>
 </mailSettings>
</system.net>