This document discusses continuous integration (CI) processes and practices. It defines CI as maintaining a single source code repository and automating the build and testing process. When code changes are committed, the CI server checks out the code, builds it, and runs unit and integration tests. If the build or tests fail, the CI server alerts the team. The document provides several rules for supercharging a CI process, including always having CI in place, managing dependencies, writing tests, keeping content up to date, and continuously deploying items and code changes. Continuous deployment involves serializing content changes, building packages, and deploying packages to environments.
8. CI -The Practice
• Maintain a single source repository
• Automate the build
• Make your build self-testing
• Every commit should build on an integration machine
• Make it easy for anyone to get the latest executable
• Everyone can see what’s happening
9. CI -The Process
• Developers check out code into their private workspaces.
• When done, commit the changes to the repository.
• The CI server monitors the repository and checks out changes when they
occur.
• The CI server builds the system and runs unit and integration tests.
• The CI server releases deployable artefacts for testing.
• If the build or tests fail, the CI server alerts the team.
• Continue to continually integrate and test throughout the project.
13. “It is cheaper to find bugs in lower environments. It is really
cheap on a Dev Box and really expensive on Production.”
- CharlesTurano, CTO, Hedgehog Development
14. “Continuous Integration doesn’t get rid of bugs, but it does
make them dramatically easier to find and remove.”
- Martin Fowler, Chief Scientist,ThoughtWorks
19. Rule #2 Branches
Make sure to …
• … have a master branch
• … have a development branch
• … create tags for production releaases
• … have feature branches for long running features
• … use hotfix branches as necessary
26. Rule #3 Front-end Dependencies
Never version compiled front-end resources (css, javascipt
etc.) into source control. Let the build compile them the
same way it does with your C# code!
28. Rule #4 Make yourSitecore code testable
• Use MVC
• Always depend on abstractions not on implementations
• Consider using Dependency Injection frameworks
• Use ORMs – Glass, Fortis, Synthesis
• Make sure to try Sitecore.FakeDb
35. Continuously Deploying Items
Usually a 3 step process:
1. Find a way to serialize your items and bring them to
source control
2. Build a package out of your serialized items
3. Deploy the package to the environment
38. ContinuouslyDeployingItems – Installingthe Package
• Sitecore.Ship – Automatically installs packages posted
via HTTP
• Sitecore Package Deployer – Automatically installs
packages from deployed on the file system
39. Continuously Deploying Items- Notes
• TDS can deploy items directly(without a need for
packaging), if the build server has access to the
webserver file system
• Unicorn can deserialize deployed serialized items
without the need for packaging
40. Continuously Deploying Items–SomeAdvices
1. Keep a minimum amount of content versioned in source
control
2. Never deploy content and media to higher
environments, use tools or packages to move them
3. Always backup the databases before deploying items
41. Continuous Deployments -Scripting
• Embrace the scripting !!!!
• Invest some time to learn PowerShell
• Script common tasks as DB andWebsite Backups
• Script common SitecoreTasks with Sitecore PowerShell
Extensions
43. My perfect production build scenario
1. Clean Code Checkout
2. Restoring NuGet Packages
3. Restoring and Recompiling Frontend Assets
4. Running UnitTests (Integration – lower environments)
5. Automated PowerShell backups (Remote Execution)
6. Building CM and CD Packages
7. Deploy and install the packages (install can be manual)
Hi I am Nikola Gotsev Senior Solutions Developer at Hedgehog Development and a Sitecore MVP.
There are tons of blog posts out there – explaining how to set continuous integration with Tool X using technology Y. But non of these answers the most important question
I
Maintain a single source repository
Automate the build
Make your build self-testing
Every commit should build on an integration machine
Make it easy for anyone to get the latest executable
Everyone can see what’s happening
Developers check out code into their private workspaces.
When done, commit the changes to the repository.
The CI server monitors the repository and checks out changes when they occur.
The CI server builds the system and runs unit and integration tests.
The CI server releases deployable artefacts for testing.
If the build or tests fail, the CI server alerts the team.
Continue to continually integrate and test throughout the project.
Sitecore – a bit different. We also need to deploy items
How many of you have actually had to deploy on Friday ? Story about 3k emails.
I see many people just setting up automated builds – NO CI.
We have the hedgehogs of shame
Really depends on your own process, but here are some recommendations for successful branching model. GIT Shines – can be achieved with other source controls too !
… have a master branch
… have a development branch
… create tags for production releases
… have feature branches for long running features
… use hotfix branches as necessary
I also use release branches for staging – makes it more secure.
We at hedgehog use NuGet a lot ! Sean H talked about this yesterday, so I am not going to dig into it. Make sure to check it out.
Frontend Development improved a lot ! No longer just slicing designs. Embrace your frontend guys needs.
Gulp and grunt are not just frontend. You can use them to automate some parts of your development – watchers (before auto content sync). Habitat uses gulp a lot
Use MVC
Always depend on abstractions not on implementations
Consider using Dependency Injection frameworks
Use ORMs – Glass, Fortis, Synthesis
Make sure to try Sitecore.FakeDb
I see you ordering the book on amazon.
Mostly Quality Assurance Engineers job. My GF is amazing at that
For the guys who ordered the book on amazon.
Usually a 3 step process:
Find a way to serialize your items and bring them to source control
Build a package out of your serialized items
Deploy the package to the environment
Keep a minimum amount of content versioned in source control
Never deploy content and media to higher environments, use tools or packages to move them
Always backup the databases before deploying items
Clean Code Checkout
Restoring NuGet Packages
Restoring and Recompiling Frontend Assets
Running Unit Tests (Integration – lower environments)
Automated PowerShell backups (Remote Execution)
Building CM and CD Packages
Deploy and install the packages (install can be manual) – just a single manual step.