GitThis is Part 2 for TeamCity Configuration for Helix Architecture. You can have a look into Part 1:- Installing Teamcity and Connecting to BitBucket.
Part 2 will be covering the following points:-
Setting up project and creating first 4 build configurations.
- Installing node module.
- Copying Sitcore Libraries.
- Nuget Restore
- Build Project
To cover these steps we will be needing 2 extensions:-
- Gulp: – Sitecore Helix require gulp to run couple of tasks. So we will be needing gulp extension for the same.
- GIT: – It will be required to send the status to GIT.
Download Gulp and Git extension from here.
Once downloaded paste both the extensions into plugin folder inside Data Directory folder.
Default Path: – C:\ProgramData\JetBrains\TeamCity\plugins
So in our last blog, we setup teamcity, connected to bitbucket and also created the project.
Once to login into teamcity, you will be able to see your project.
- Click on the project and then click on edit project settings on the top right corner.
2. Click on Create build configurations.
3. Click proceed after providing the password.
4. Provide the build configuration name as “Install Node module” and proceed.
This will lead to configuration settings. Here we will need to modify 2 settings:-
- Build Steps and Trigger.
As we default VCS settings take master branch from bitbucket and if you want to change the branch then head to Versions Control Settings and click edit.
Here we can change branch name from master to “your branch name”.
5. Click on build Steps and add build step.
6. Select Command Line into Runner Type.
7. Save and then click on Trigger.
On Trigger we need to setup when this step will run.
If you can see “VCS Trigger” already added then click edit else add “VCS Trigger” from dropdown.
Check the checkbox under Per-checkin Triggering.
Save and this completes our first build configuration.
Now let’s add Copy Sitecore Libraries build configuration to copy sitecore libraries.
- Go back to project settings and add new build configuration with name Copy Sitecore Libraries.
- Click on build Steps and add build step.
- Select Gulp into Runner Type.
4. Fill all the fields as below. Gulp.integration.js file is the gulp file comes with habitat.
5. Save and then click on Trigger.
6. Add new trigger and select Finish Build Trigger.
7. Select Install Node Module in build configuration. So that once install node module gets completed copy sitecore libraries can run.
Now let’s add Nuget Restore build configuration:-
1. Go back to project settings and add new build configuration with name Nuget Restore.
2. Click on build Steps and add build step.
3. Select Gulp into Runner Type.
4. Fill all the fields as below. Gulp.integration.js file is the gulp file comes with habitat.
5. Save and then click on Trigger.
6. Add new trigger and select Finish Build Trigger.
7. Select Copy Sitecore Libraries in build configuration.
Now let’s add Build Project build configuration:-
1. Go back to project settings and add new build configuration with name Build Project.
2. Click on build Steps and add build step.
3. Select Visual Studio (sln) into Runner Type.
4. Select Visual Studio 2015 into Visual Studio and Target will be Rebuild.
5. Select your sln file into solution file path.
6. Create 2 build features:- VCS Labeling and Report Change status to GitHub.
6. Save and then click on Trigger.
7. Add new trigger and select Finish Build Trigger.
8. Select Nuget Restore in build configuration.
9. Click on Agent Requirements and if you find Unmet requirements: MSBuildTools14.0 then install Microsoft Build Tools 2015.
After all the above steps, TeamCity will be able to build the solution successfully.
So lets end this blog here. Next blog will contain last 3 build configurations which are:-
- Publish All Project
- Apply XML Transform
- Unicorn Sync