CI/CD Sitefinity Concept
Cloudvanti Sitefinity comes with two (2) environments, Staging and Production. Both have been integrated with Cloudvanti's CI/CD process to help ease the deployment process. In working with these two (2) environments, you shall deploy your site to the Staging environment for testing first. It shall verify the results before you approve it to continue the deployment into the Production environment.
Deployment in Cloudvanti
Cloudvanti uses CI/CD processes to ensure a reliable deployment procedure for your application.
Source Code CI/CD Pipeline
In the source code repository, the CI/CD is integrated with the Master branch. Any changes made in the Master branch shall automatically commit to the pipeline. In the CI Pipeline, your code will be built into an artefact that will be deployed into the CD Pipeline, which then deploys to the App Service.
In Cloudvanti Sitefinity, we utilise Azure App Service Deployment Slots for the Production environment. Production Slot V1 is the current live website, and Deployment Slot V2 is the existing website with new code(s). When you deploy your code, it will be deployed into this deployment slot. The Deployment Slot has its own Database, so any testing process that causes changes in the Database will not affect the live one on website. When Deployment Slot V2 is ready, it will be swapped with the live server (Deployment Slot V1). With it, the live website will not experience downtime when deploying the changes.
Here is a diagram for the full workflow of the source code pipeline process:
Database CI/CD Pipeline
For the database repository, the CI/CD is separated by the Staging and Production branch. Changes made in Staging and Production will automatically be committed into the pipeline. The CI Pipeline publishes the SQL script to the CD Pipeline to be executed into the Azure database.
Cloudvanti utilises the secondary database used by the CD Pipeline process. This is to ensure that the Live database is intact and free from any alterations by failed deployments.
Here are the steps in how the deployments work:
- During the first CD process, the CD Pipeline will run the task to copy Primary DB into the Secondary DB.
- The Secondary DB will connect to Deployment Slot V2.
- The CD Pipeline executes the script within the Secondary DB.
- The User Approver will be able to test deployments by accessing the Deployment Slot.
- Once the deployment process has succeeded, the User Approver is able to approve the Pipeline to swap Production with Deployment. Next, Primary DB will be deleted.
List of Pipelines
For the CI Pipeline, Cloudvanti Sitefinity provides one Pipeline to build the source code with the name <subscription_name>-SRC.CI.
Build the source code to artefact
Publish the SQL script to be deployed to the Staging database
Publish the SQL script to be deployed to the Production database
The following list is for CD pipelines in Cloudvanti Sitefinity:
Deploy the Codes to Staging and Production
Restore Database bacpac - Staging
Restore Database bacpac - Production
Backup Database - Staging
Backup Database - Production
Deploy Database sql script - Staging
Deploy Database sql script - Production