Professional Documents
Culture Documents
Cloud
Objective:
The objective of this lab is to guide you through the process of setting up a
Continuous Delivery (CD) pipeline using Jenkins to automate the deployment
of a sample application to the Azure cloud platform.
Prerequisites:
• Jenkins installed and accessible (Refer to the "Installing Jenkins on
Azure Cloud" lab manual)
• Sample application source code hosted in a version control system (e.g.,
GitHub)
• Azure account with necessary permissions to create and manage
resources
• Basic understanding of Jenkins, version control systems, and Azure
services
Lab Steps:
5. Configure Pipeline:
• In the pipeline configuration page:
• Under General, define your pipeline description.
• Under Pipeline, select Pipeline script from SCM as the
Definition.
• Choose your version control system (e.g., Git) and provide the
repository URL.
• Specify the branch to build (e.g., main or master).
• Save your configuration.
6. Create Jenkinsfile:
• In your source code repository, create a Jenkinsfile at the root level.
• Define your pipeline stages and steps in the Jenkinsfile. Include stages
for build, test, and deploy. For example:
groovyCopy code
pipeline {
agent any
stages {
stage('Checkout') {
steps {
stage('Build') {
steps {
stage('Test') {
steps {
sh 'mvn test'
steps {
azureWebAppPublish appName: 'your-app-name',
resourceGroup: 'your-resource-group',
filePath: 'target/*.war'
post {
always {
// Clean up or notify
success {
// Notify success
failure {
// Notify failure
9. Verify Deployment:
• Once the pipeline execution is complete, verify that your application is
deployed to the Azure App Service.
• Access your deployed application using the Azure App Service URL.
10. Post-Deployment Actions (Optional):
• Optionally, configure post-deployment actions such as setting up
custom domain, configuring SSL, or integrating with Azure monitoring
services.
Conclusion:
In this lab, successfully created a Continuous Delivery (CD) pipeline using
Jenkins to automate the deployment of a sample application to the Azure
cloud platform. By integrating Jenkins with Azure services, you can establish
a robust CD workflow that streamlines the deployment process and enhances
the efficiency of your software delivery pipeline.