AN APPROACH TO *NIX-HOSTED JENKINS SERVER TO WINDOWS SERVER CONTINUOUS DEPLOYMENT
Indu Sharma(Acharya)
Co-Founder @ Jureli Tech | Ex-Amazon | Ex-Thales/Guavus | NIT Durgapur
Introduction??
This document outlines the setup of an automated deployment pipeline that transfers web applications from Azure DevOps to a Windows IIS server using Jenkins and PowerShell. It is crucial to understand that this design considers the limitation of not being able to add Windows as a worker node in Jenkins.?
The pipeline orchestrates the build process on an AWS EC2 Ubuntu instance running Jenkins, while deployment operations are executed on an AWS EC2 Windows Server 2022 Datacenter instance hosting IIS. Secure file transfer is facilitated through SMB shares, and notifications are sent to Slack or MS Teams via webhooks as shown in diagram below.??
?
Infrastructure Details & Testing?
Systems Requirements:?
Testing:?
The deployment pipeline has been thoroughly tested with the following infrastructure:?
High-Level Design (HLD)?
Components:?
Connections:?
Low-Level Design (LLD)??
Jenkins Pipeline:?
Windows IIS Server Operations:?
PowerShell Script Execution:?
Security Considerations:?
Testing Environment:?
Pipeline Breakdown?
Jenkins Pipeline Overview?
The Jenkins pipeline, hosted on an AWS EC2 Ubuntu instance, manages the CI/CD process. It fetches source code from Azure DevOps, builds the application, and deploys it to the Windows IIS server.?
Jenkins Pipeline Stages?
Jenkins Requirements?
Ensure the following are installed on the Jenkins server:?
```sh?
snap apt-get install smbclient --classic?
```?
This is required as the .NET SDK plugin does not work correctly in some environments.?
```sh?
snap apt-get install dotnet --classic?
```?
PowerShell Deployment Script Overview?
A PowerShell script automates deployment operations on the Windows IIS server. It facilitates copying new builds from SMB shares to the IIS web root, recycles application pools in IIS, and ensures seamless deployment. PowerShell script performs following steps:?
Prepare and Backup:?
Deploy:?
Cleanup and Update:?
?
Scheduling PowerShell Script via Windows Task Scheduler?
For detailed instructions on scheduling a PowerShell script using Windows Task Scheduler, refer to? Microsoft documentation on creating scheduled tasks .?
Script Execution and Monitoring?
Once scheduled, the PowerShell script performs the following actions:?
This automation streamlines deployment processes, minimizing manual intervention and enhancing deployment efficiency.?
Best Practices?
Conclusion?
This article provides a comprehensive guide for setting up an automated deployment pipeline. By following these steps, DevOps engineers can ensure efficient and reliable deployments from Azure DevOps to the Windows IIS server, enhancing the overall software delivery process.?