Accelarate Helix based Sitecore project initial setup and project addition included with common needs.
Just use the following parameters when you call init.ps1
or add-project.ps1
or add-module.ps1
optionally:
configPath
templatePath
targetPath
I suggest to download this repository and put it into your own, so your folder structure would look like this for instance:
Helix.Skeleton
sk-base
sk-queue
sk-scripts
sk-configs
sk-templates
target
src
...
Change the following files/folders if you want to use your own template or configuration:
sk-configs\default.config.json
sk-templates\add-module\default\feature\
sk-templates\add-project\default\feature\
sk-templates\add-project\default\foundation\
sk-templates\init\default\
Create your own variants of the scripts, e.g.:
init.ps1 -targetPath "C:\projects\MyProject\src"
add-project.ps1 -targetPath "C:\projects\MyProject\src"
add-module.ps1 -targetPath "C:\projects\MyProject\src"
So other developers from the team can use the scripts above.
- Run the
init.ps1
PowerShell script from thesk-scripts
folder, which sets up your solution based on Sitecore 9.1default.config.json
by default. Here is all the settings what you can change:
{
"projectName": "MyProject",
"targetFramework": "v4.7.1",
"nugetTargetFramework": "net471",
"aspNet": {
"lib": "net45",
"mvcVersion": "5.2.3",
"webPagesVersion": "3.2.3",
"razorVersion": "3.2.3"
},
"sitecore": {
"version": "12.0.0",
"lib": "net471"
},
"sitecoreMvc": {
"version": "3.0.0",
"lib": "net471"
},
"glassMapper": {
"version": "4.5.0.4",
"lib": "net45",
"sitecoreVersion": "111",
"mvcVersion": "Mvc52"
},
"castle": {
"version": "3.3.3",
"lib": "net45"
},
"rainbow": {
"version": "2.0.0",
"lib": "net452"
},
"rainbowCodeGeneration": {
"version": "0.3.0",
"lib": "net452"
},
"microsoftDependencyInjection": {
"version": "2.1.1",
"lib": "netstandard2.0"
},
"microsoftDependencyInjectionAbstraction": {
"version": "2.1.1",
"lib": "netstandard2.0"
},
"unicorn": {
"version": "4.0.3",
"lib": "net452"
},
"configy": {
"version": "1.0.0",
"lib": "net45"
},
"kamsarWebconsole": {
"version": "2.0.0",
"lib": "net40"
},
"microCHAP": {
"version": "1.2.2.2",
"lib": "net45"
},
"[guid]" : {
"type" : "guid",
"format": "D"
},
"[[subProjectId]]" : {
"type" : "guid",
"format" : "D"
}
}
- Install Sitecore into the
sitecore
folder - Data, Database, Website - Add the
https://sitecore.myget.org/F/sc-platform-9-1/api/v3/index.json
to the nuget package sources - Run a build: call the
build\build.cmd
. It deploys all the web projects at once into thesitecore\Website
folder. - Run the
unicorn_source_setup.ps1
PowerShell script in thebuild
folder, which sets the sourceFolder for Unicorn insitecore\Website
- Run the
add-project.ps1
command with 2 required parameters:subProjectName
: name of the new project (e.g.Navigation
)templateName
: name of the subfolder from.\sk-templates\default
(feature
orfoundation
)
- This command uses the same
default.config.json
config above - Include the newly generated project to your Visual Studio solution manually
- Run the
add-module.ps1
command with 3 required parameters:moduleName
: name of the new module (e.g.TextModule
)subProjectName
: name of the new project (e.g.Navigation
)templateName
: name of the subfolder from.\sk-templates\default
(feature
orfoundation
)
- This command uses the same
default.config.json
config above - Include the newly generated files to your Visual Studio project manually
For more documentation about the generator, checkout the base project: https://github.com/trnktms/sk-base
Important: your JSON configuration should be in sync with your template!
- Log in the sitecore as admin
- Open the unicorn page : {yourdomain/unicorn.aspx}
- Syncronise all the projects
Note: Some idea and code implementation based Neil Shack's Helixbase project - https://github.com/muso31/Helixbase