CI/CD, which stands for continuous integration (CI) and continuous delivery (CD), is a reliable software delivery process.
Automated testing enables continuous delivery that ensures software quality and less time to deploy the same on the desired server. It improves efficiency in every pipeline run as we can define our testing Jobs as well in the agent. The significant increase in overall delivery speed is enabled by CI/CD pipelines.
CI could be viewed as the first step of the process and CD as the second step for creating and deploying your code. CI is more about getting the code ready to be released – fetching code from the repo and then building the solution(build/test), while CD is the actual deployment of the code onto the desired server(release/deploy).
There are many tools available to create a ci/cd pipeline in it. Like, Azure DevOps, Jenkins
We are now creating CI/CD on Azure DevOps via the classic editor; we can also use.YAML files to create a CI/CD pipeline.
Sitecore CI/CD implementation on Azure DevOps
Click on the new pipeline button on the Azure DevOps dashboard to get started.
Here, you will get this page then use the classic editor to configure your pipeline without the YML, Then select where your repo is present, in my case, I am selecting GitHub.
We need to select on which platform our code is, options descriptions are also present there to clarify. Then fill out the details of “Repository” and “Default branch for manual and scheduled builds”.
Then click continue,
We need to provide our pipeline with a template now, which we can do with YAML or Azure provides some jobs predefined as per our source code.
In our case, we will select ASP.Net as our pipeline template for Sitecore.
When we click on Apply, this will create 6 jobs predefine jobs for our pipeline shown below,
Here in the parameters, we can add our solution file path, as shown above, directly to that path via the three dots available on the right of the field.
We can now configure these jobs according to us and create a CI pipeline.
The first job is NuGet tool installer, where there will be few details available pre-filled, As of now, we have NuGet package version 4.4.1 which will work fine.
So, here we don’t need to change anything.
Next, we have NuGet restore Job.
Here we need to change Feeds to use field as mentioned above.
Select Feeds in my NuGet.config (Radio button)
Then provide NuGet.config file path in your repo below the path to NuGet.config field.
No other changes need to be done here in this job now. We can go Ahead
In the Next Job, we need to select option clean as this will clean your solution at the time of build.
Then we need to remove the pre-present variable and script in MSBuild Arguments(Here in this section we can add variables or paths to the solution and other stuff – we already selected our solution above so no need to add anything there).
Your solution file name will show up in the Solution filed section as shown above.
“Publish artifacts” is the next job where all this build will be available in the form of Drop. No configuration changes are needed, default values are present in configuration sections. Now click on save and run, this will trigger your CI pipeline as shown below.
CI/CD jobs will execute one by one,
One Agent will be allocated per CI/CD execution as shown above which will be a self-hosted agent. The self-hosted agents can give you additional control to install dependent software needed for your builds as well as deployments.
All job statuses will be visible while the CI pipeline is running.
When the CI pipeline will finish, it gives us an artifacts folder called Drop – which will have all your repo. code data, in our case, all dll files and views. When we open these artifact files, we can have a view of the drop folder and all our code files there.
Here our CI pipeline ends.
In summary, a CI pipeline automates the integration and testing of code changes, while a CI/CD pipeline extends this to include automated deployment to different environments. Together, they enable developers to deliver high-quality software faster, with greater confidence and consistency