XenonStack Recommends

Application Modernization

Continuous Integration using Powershell and Jenkins

Gursimran Singh | 28 February 2017

Getting Started with Continuous Integration

Application Modernization enables the migration of monolithic applications to new Microservices architecture with Cloud Native Support including Continuous Integration and Continuous Delivery to meet the current business needs. Jenkins is a Continuous Integration software tool for testing and reporting changes in a large code base in Real-Time. Jenkins enables developers to find and solve defects in a code base rapidly and to automate testing of the builds. PowerShell is an automated task framework from Microsoft, a command line shell and a scripting language integrated into the .NET framework, used within other applications. It automates Batch Processing and creates system management tools.

Challenges for Continuous Integration with Jenkins and PowerShell

  • Enable file sharing between nodes/systems.
  • A common user who has all permission to perform a task.
  • Avoid adding every node or system as an agent in Jenkins to perform a task.
  • Making Powershell script compatible with every version of PowerShell.
  • No third party plugin.
  • Creating a hook concept for different repos on GitHub and Bitbucket.

Solution Offerings for Continuous Integration

  • GitHub and BitBucket Repo set up to keep the source code.
  • PowerShell Script to execute the Source Code Deployment.
  • Alerts generated in the form of Email depending upon the deployment status.
  • Logs generated for every job build.
  • Set up WebHook for GitHub and BitBucket Repo.

Understanding How to Trigger Jobs Using Jenkins and PowerShell

Trigger Jobs Using Jenkins

  • Download Jenkins and go to Jenkins Dashboard.
  • Click on manage Jenkins.
  • Click on Configure Jenkins.
  • Click on JDK installation.
  • Configure Jenkins with Selenium.
  • Create Selenium Script to create a Batch File to be used in Jenkins.
  • Go to project Root Directory and create a Library Folder.
  • Schedule Jenkins Job by clicking on Jenkins Job to configure.
  • Build Trigger as well as click on Build Periodically option.
  • Select Email notification through Manage Jenkins section.
  • Run Selenium script through command line.

Trigger Jobs Using Powershell

  • Download Powershell Latest version.
  • Find the Azure Backup PowerShell command-let.
  • Sign in to Azure account.
  • Select the subscription needed.
  • Register Azure Recovery Service provider with the subscription if using the account for the first time.
  • Verify successful registration.
  • Create a Recovery Service Vault.
  • View Vaults in subscription.
  • BackUp Azure Virtual Machines.
  • Trigger and Monitor BackUp
  • Restore Azure Virtual Machine through recovery point, restoring the disk and creating Virtual Machine from restored disk.
  • Restore files from Azure Virtual Machine BackUp.