General

Gigansoft OnPrem Devops Solution

Building a Robust On-Premise CI/CD Pipeline: Jenkins, Bitbucket, IIS, PowerShell, and Selenium in Action

In the age of cloud-native development, continuous integration and continuous deployment (CI/CD) have become the cornerstone of agile DevOps practices. However, for many enterprises — especially those with compliance, data residency, or internal infrastructure constraints — an on-premise CI/CD pipeline remains a strategic and necessary choice.

In this article, we’ll walk through how organizations can build a secure, automated, and efficient CI/CD environment using tools like Jenkins, Bitbucket, IIS, PowerShell, and Selenium — all hosted on-prem.


🔧 Why On-Premise CI/CD?

While cloud-based DevOps platforms offer convenience, on-premise CI/CD offers:

  • Complete control over infrastructure

  • Compliance with internal or industry data regulations

  • Enhanced security for sensitive source code

  • Seamless integration with internal legacy systems

Let’s explore how to set up a production-grade CI/CD system using proven open-source and Microsoft-native tools.


🔄 CI/CD Workflow Overview

A typical on-premise DevOps pipeline involves the following steps:

  1. Code Commit & Version Control – Bitbucket

  2. Build Automation & Orchestration – Jenkins

  3. Artifact Packaging & Testing – Jenkins + Selenium

  4. Deployment to Web Servers – PowerShell + IIS

  5. Monitoring & Rollback Capabilities

Let’s dive deeper into each stage.


🗃️ Step 1: Source Code Management with Bitbucket Server

Bitbucket Server (formerly Stash) is a self-hosted Git repository management solution from Atlassian. It integrates smoothly with Jira, Jenkins, and local user directories (LDAP/AD).

Benefits:

  • Fine-grained branch permissions

  • Internal Git repo hosting behind firewalls

  • Easy integration with Jenkins via Webhooks or API polling

Developers commit code changes to feature branches, which trigger Jenkins pipelines for build and test.


🔨 Step 2: Jenkins – The Heart of Automation

Jenkins remains the industry standard for CI/CD automation. Installed on-prem, it provides full control over build agents, plugin versions, and credentials management.

Use Cases in On-Prem DevOps:

  • Multi-stage pipeline builds (via Jenkinsfile)

  • Parallel testing using Jenkins agents

  • Secure credentials management with HashiCorp Vault or Jenkins Secrets

Typical pipeline stages:

groovy
pipeline {
agent any
stages {
stage('Build') {
steps {
bat 'dotnet build MyApp.sln'
}
}
stage('Test') {
steps {
bat 'dotnet test MyApp.Tests.dll'
}
}
stage('Deploy') {
steps {
powershell './deploy.ps1'
}
}
}
}

🖥️ Step 3: Deploying to Microsoft IIS using PowerShell

For .NET-based applications or enterprise web platforms, IIS remains a robust and proven web server. Using PowerShell, Jenkins can deploy builds directly to multiple IIS servers.

Example PowerShell Script:

powershell

Import-Module WebAdministration

Stop-WebAppPool “MyAppPool”
Copy-Item -Path “C:\builds\MyApp” -Destination “D:\inetpub\wwwroot\MyApp” -Recurse -Force
Start-WebAppPool “MyAppPool”

You can integrate this deployment step directly in your Jenkinsfile using the powershell directive, ensuring deployments are fast, reliable, and scriptable.


🧪 Step 4: Automated Testing with Selenium

Testing is a critical part of the pipeline. Selenium is widely used for automated UI testing and can be easily integrated into Jenkins pipelines.

Typical Integration Includes:

  • Running headless browser tests in Chrome/Firefox

  • Generating HTML or JUnit-style test reports

  • Triggering automated regression testing for every commit

Selenium Grid can be hosted on-prem to distribute tests across machines and browsers, ensuring cross-platform coverage.


🔄 Rollbacks and Safe Deployments

By integrating versioned artifacts and Git tagging in Bitbucket, rollback strategies become seamless. For instance, Jenkins can store build artifacts in a shared folder or Artifactory, and rollback deployments can be scripted using tags or previous builds.


📈 Monitoring and Maintenance

Once your pipeline is up and running, ongoing observability is key. Consider integrating:

  • Grafana + Prometheus for metrics (Jenkins agent usage, deployment duration)

  • Windows Event Log + PowerShell for deployment logs

  • Sentry / ELK Stack for application error tracking


💡 Best Practices for On-Prem DevOps

  • Use Infrastructure as Code (IaC) for provisioning (e.g., PowerShell DSC or Terraform for VM setups)

  • Implement RBAC and audit logs in Jenkins and Bitbucket

  • Maintain offline copies of critical plugins and dependencies

  • Regularly patch all tools and dependencies (especially Jenkins core/plugins)


✅ Conclusion

A well-designed on-premise CI/CD pipeline using Jenkins, Bitbucket, IIS, PowerShell, and Selenium can provide your organization with full control, compliance, and confidence in software delivery. While it requires more maintenance than SaaS platforms, the flexibility and security benefits often outweigh the overhead.

At Gigansoft, we help organizations architect, build, and optimize secure on-prem DevOps environments tailored to business needs. Whether you’re modernizing legacy systems or building greenfield pipelines, our DevOps engineers are ready to assist.


✉️ Interested in deploying your own on-prem DevOps pipeline?
Contact us today for a consultation.