Devops
Devops
Devops
Laboratory
Record
Register Number :
Department :
Semester :
BONAFIDE CERTIICATE
University Reg.No. This is to certify that this is a bonafide
Vision of Institute
Velammal Institute of Technology is committed to be a leader in innovative work force development
and a world class learning venue for the ever-changing needs of business and Industry.
Mission of Institute
To promote quality education & technical skills to meet the industry requirements.
To incorporate Team work, Leadership skills & Lifelong learning.
To facilitate Career development & Higher education assistance
To encourage innovative ideas for Research & Development and Entrepreneurship for societal
needs.
To inculcate Ethical responsibility & Human values
PEO II:
Exhibit technical leadership, team skills and entrepreneurship skills to provide business solutions to
real world problems.
PEO III:
Work in multi-disciplinary industries with social and environmental responsibility work ethics and
adaptability to address complex engineering and social problems
PEO IV:
Pursue lifelong learning, use cutting edge technologies and involve in applied research to design
optimal solutions.
PSO2:
Have knowledge to build, automate and manage business solutions using cutting edge technologies.
PSO3:
Have excitement towards research in applied computer technologies.
Program Outcomes
Program Outcomes
Engineering knowledge: Apply the knowledge of mathematics, science, engineering
PO1 fundamentals, and an engineering specialization to the solution of complex engineering
problems.
Problem analysis: Identify, formulate, review research literature, and analyze complex
PO2 engineering problems reaching substantiated conclusions using first principles of
mathematics, natural sciences, and engineering sciences.
Design/development of solutions: Design solutions for complex engineering problems and
design system components or processes that meet the specified needs with appropriate
PO3 consideration for the public health and safety, and the cultural, societal, and environmental
considerations.
Conduct investigations of complex problems: Use research-based knowledge and research
PO4 methods including design of experiments, analysis and interpretation of data, and synthesis
of the information to provide valid conclusions.
Modern tool usage: Create, select, and apply appropriate techniques, resources, and modern
PO5 engineering and IT tools including prediction and modeling to complex engineering
activities with an understanding of the limitations.
The engineer and society: Apply reasoning informed by the contextual knowledge to assess
PO6 societal, health, safety, legal and cultural issues and the consequent responsibilities relevant
to the professional engineering practice.
Environment and sustainability: Understand the impact of the professional engineering
PO7 solutions in societal and environmental contexts, and demonstrate the knowledge of, and
need for sustainable development.
Ethics: Apply ethical principles and commit to professional ethics and responsibilities and
PO8 norms of the engineering practice.
Individual and team work: Function effectively as an individual, and as a member or
PO9 leader in diverse teams, and in multidisciplinary settings.
Communication: Communicate effectively on complex engineering activities with the
engineering community and with society at large, such as, being able to comprehend and
PO10 write effective reports and design documentation, make effective presentations, and give and
receive clear instructions.
Project management and finance: Demonstrate knowledge and understanding of the
PO11 engineering and management principles and apply these to one’s own work, as a member
and leader in a team, to manage projects and in multidisciplinary environments.
Life-long learning: Recognize the need for, and have the preparation and ability to engage
PO12 in independent and life-long learning in the broadest context of technological change.
CCS342 DEVOPS LAB MANUAL
TOTAL: 30 Periods
Exp No : 1
Create Maven Build Pipeline in Azure.
Date : 24-08-24
AIM:
To create an automated Maven build pipeline in Azure DevOps for efficient Java application
development.
ALGORITHM:
Step 1:Organization is created.
Step 2: Organization by clicking the new project button .
Step3: Create Pipeline.
Step4: Configure new project.
PROCEDURE:
RESULT:
Thus the above programmers Create Maven Build Pipeline in Azure executed successfully.
Exp No : 2
Run regression tests using Maven Build pipeline in Azure.
Date : 27-08-24
AIM:
ALGORITHM:
PROCEDURE:
1: Create a New Build Pipeline
Open your Azure DevOps project.
Navigate to Pipelines > Builds.
Click on the "+ New" button to create a new build pipeline.
2: Configure the Source Repository
Select the repository where your Maven project is stored.
Choose the branch you want to build.
3: Configure the Build Pipeline
Choose a template: Select "Maven" as the template for your pipeline.
4: Configure the Maven Task
In the pipeline editor, you will see a task named "Maven" (or similar). Click on it to configure the
Maven task.
In the "Goals" field, specify the Maven goals needed to run your regression tests. For example, if
your regression tests are part of the "integration-test" phase, you can enter: clean integration-test.
Set other Maven-related configurations as needed (e.g., POM file, options).
5: Add Test Reporting (Optional)
If your regression tests produce test reports, you might want to publish them in Azure DevOps.
After the Maven task, add a task to publish the test reports. For example, if your tests generate
Surefire or Failsafe reports, you can use the "Publish Test Results" task and specify the path to the
test report XML files.
6: Save and Queue the Pipeline
After configuring the pipeline, click on "Save & Queue" to save your changes and trigger a
build.
7: Monitor the Build
Once the pipeline is triggered, it will run the Maven build, including the regression tests.
You can monitor the progress and results in the Azure DevOps pipeline interface.
8: Set Up Triggers (Optional)
You can set up triggers to automatically run the build pipeline when changes are pushed to specific
branches.
Configure branch filters and triggers according to your needs.
Remember that Azure DevOps provides a flexible environment, and you can customize your pipeline
further to accommodate your specific project requirements.
OUTPUT:
RESULT:
Thus, the above programs completed run regression tests using a Maven build pipeline in Azure output is
verified successfully.
Exp No : 3
To install Jenkins in a Cloud Environment.
Date : 3-09-24
AIM:
The aim of installing Jenkins in the cloud is to automate and scale software development processes for
faster, reliable builds and deployments.
ALGORITHM:
Step 1: Create a Virtual Machine.
Step 2: Navigate to the EC2 service (Elastic Compute Cloud).
Step 3: Security Group Configuration.
Step 4: Connect to the Virtual Machine.
Step 5: Install Java.
Step 6: Install Jenkins.
Step 7: Access Jenkins Web Interface.
Step 8: Complete Jenkins Setup.
Step 9: Customize and Secure.
PROCEDURE :
Example: Installing Jenkins on a Virtual Machine in AWS
Choose a Cloud Provider: Decide on a cloud provider that you want to use. For this example, let's
use Amazon Web Services (AWS).
1. Create a Virtual Machine:
Log in to your AWS console.
Navigate to the EC2 service (Elastic Compute Cloud).
Click on "Launch Instances" to create a new virtual machine.
Choose an Amazon Machine Image (AMI) that supports your desired operating system (e.g.,
Amazon Linux, Ubuntu Server).
Configure the instance details (instance type, networking, etc.).
Add storage as needed.
2. Security Group Configuration:
Configure security groups to allow incoming traffic on the necessary ports. Jenkins typically uses
port 8080 for web access and optionally other ports for agents.
3. Connect to the Virtual Machine:
Once the virtual machine is launched, connect to it using SSH.
You can use the public IP address or DNS name provided by AWS.
4. Install Java:
Jenkins requires Java to run. Install Java on the virtual machine using the package manager for your
chosen operating system.
5. Install Jenkins:
Add the Jenkins repository to your package manager's sources.
Install Jenkins using the package manager.
Start the Jenkins service.
6. Access Jenkins Web Interface:
Open a web browser and navigate to the public IP address or DNS name of your virtual machine,
followed by port 8080.
You will need to enter the initial administrator password, which can be found on the virtual machine
in a file.
7. Complete Jenkins Setup:
Follow the on-screen instructions to complete the Jenkins setup process.
Install recommended plugins or select the plugins you need.
Create an admin user account.
8. Customize and Secure:
Configure Jenkins settings according to your preferences.
Implement security measures, such as setting up authentication, authorization, and HTTPS.
OUTPUT:
Step1: Enter the IP Address in url:103.43.200.163
Step2: Sign in to the AWS Management Console.
Step3: Open the Amazon EC2 console
Step4: select Security Groups
RESULT:
Thus the above install Jenkins in a cloud environment and completed successfully completed.
Exp No : 4 Creating a Continuous Integration (CI) pipeline using
Jenkins.
Date : 10-09-24
AIM:
To Creating a Continuous Integration (CI) pipeline using Jenkins.
ALGORITHM:
Step 1: Login into your Jenkins account as shown below.
Step 2: Once logged in, the user will be redirected to the Jenkins console.
Step 3: To create a new project, select the option.
Step 4: Now a list of options will be visible on the screen.
Step 5: Once redirected.
PROCEDURE :
Prerequisites:
Jenkins installed and running.
A version control system (e.g., Git) repository containing your code.
1. Steps to Create a CI Pipeline in Jenkins:
Create a New Jenkins Job:
Log in to your Jenkins dashboard.
Click on "New Item" to create a new job.
Enter a name for your job (e.g., "McJob") and select the "Pipeline" option.
2. Configure Pipeline:
In the pipeline section, select "Pipeline script" from the Definition dropdown.
You can write your pipeline script directly in the Jenkins UI or load it from a Jenkins file located in your
version control repository.
3. Write the Pipeline Script:
Below is a basic example of a Jenkins pipeline script that checks out code, builds it, and runs tests. Customize
it according to your project's needs.
pipeline {
agent any
stages { stage('Checkout') {
steps { checkout sum
}}
stage('Build') {steps {
// Replace with your build commands (e.g., compiling, packaging)
sh 'echo "Building"'
}}
stage('Test') { steps {
// Replace with your test commands (e.g., unit tests, integration tests)
sh 'echo "Testing"'
} } }}
(e.g., unit tests, integration tests) sh 'echo "Testing"' } } } }
4. Save and Run:
Save your pipeline configuration.
Click on "Build Now" to trigger the pipeline.
Jenkins will run the pipeline steps defined in your script.
5. View Pipeline Results:
You can view the progress and results of your pipeline by clicking on the job name and selecting a specific
build number.
Jenkins will display the console output and the status of each stage.
OUTPUT:
Step 1: Login into your Jenkins account as shown below.
Step 2: Once logged in, the user will be redirected to the Jenkins console,
Step 3: To create a new project, select the option.
Step 4: Now a list of options will be visible on the screen.
Step 5: Once redirected.
RESULT:
Thus the above program Creating a Continuous Integration (CI) pipeline using Jenkins.
Exp No: 5 Create a CD pipeline in Jenkins and deploy in Cloud.
Date : 24-09-24
AIM:
To Create a CD pipeline in Jenkins and deploy in Cloud.
ALGORITHM:
Step1: Click on Freestyle project.
Step2: Source Code Management window.
Step3: Jenkins needs to fetch all the repository files.
Step4: Go to the Build tab and add the build step .
Step5: Drop- down file menu.
Step 6: Build Now.
PROCEDURE :
1. Prerequisites:
Jenkins installed and running.
AWS account and Elastic Beanstalk environment set up.
Your code hosted in a version control repository (e.g., GitHub).
Here's a high-level overview of the steps to create the pipeline:
2. Set Up Jenkins Job:
Log in to your Jenkins instance.
Create a new pipeline job.
In the pipeline configuration, choose your version control system (e.g., Git) and provide the
repository URL.
Configure Jenkins file: Create a Jenkins file in your repository's root directory. This file defines the
pipeline stages and steps.
pipeline {
agent any
stages {
stage('Checkout') {
steps {
checkout scm
}
}
stage('Build') {
steps {
// Perform build steps (e.g., compile code, package artifacts)
}
}
stage('Deploy') {
steps {
// Deploy to cloud environment (e.g., AWS Elastic Beanstalk)
sh '''
aws configure set aws_access_key_id <your_access_key>
aws configure set aws_secret_access_key <your_secret_key>
eb init <your_eb_app_name> -p <your_eb_platform>
eb deploy
'''
}
}
}
}
AIM:
To create simple Ansible playbook for setting up a basic web application.
ALGORITHM:
Step 1: Gather facts about the target hosts.
Step 2: Update the package cache based on the OS family (Debian or RedHat).
Step 3: Preconfigure MySQL root password (for Debian-based systems).
Step 4: Install required packages (nginx and MySQL-server) based on the OS family.
Step 5: Start and enable the nginx service.
Step 6: Start and enable the MySQL service.
Step 7: Copy the Nginx configuration file to the target machine.
Step 8: Restart the nginx service if configuration changes are made.
Step 9: Create a MySQL database for the web application.
Step10: Display the execution summary of all tasks.
PROCEDURE:
1. name: Setup Web Application Infrastructure
hosts: all
become: yes
2. tasks:
name: Update apt cache (Ubuntu) or yum cache (CentOS)
apt:
update cache: yes
when: ansible_os_family == "Debian"
OUTPUT:
Setup Web Application Infrastructure
Gathering Facts =ok: [all]
Update apt cache (Ubuntu) =changed: [all]
Preconfigure MySQL root password (Debian)=changed: [all]
Preconfigure MySQL root password again for confirmation (Debian)=changed: [all]
Install required packages (Debian)=changed: [all]
Start and enable Nginx service =changed: [all]
Start and enable MySQL service =changed: [all]
Copy nginx configuration file]=changed: [all]
Create database for the web application=changed: [all]
RUNNING HANDLER [Restart Nginx] =changed: [all]
PLAY RECAP all : ok=10 changed=8 unreachable=0 failed=0 skipped=0 rescued=0
ignored=0
RESULT:
Thus the above program are successfully Create an Ansible playbook for a simple web application infrastructure.
Exp No : 7
Build a simple application using Gradle.
Date : 15-10-24
AIM :
To build a simple application using Gradle.
ALGORITHM:
Step 1:Create a Project Directory.
Step 2:Navigate to the Project Directory.
Step 3:Create the build. Gradle File.
Step 4:Create the src Directory.
Step 5:Create Package Directory Structure.
Step 6:Add Java Code.
Step 7:Run Gradle Wrapper Command.
PROCEDURE:
repositories {
jcenter()
}
dependencies {
compile 'com.google.guava:guava:30.1-jre'
}
source Sets {
main {
java {
srcDir 'src'
}
}
}
4. Create the src Directory:
In the project directory, create a folder named src.
5. Create Package Directory Structure:
Inside the src folder, create subdirectories that match your package name (e.g., com/example).
6. Add Java Code:
Inside the com/example directory, create a file named Main.java.
package com.example;
import com.google.common.base.Joiner;
OUTPUT:
Hello Gradle.
RESULT:
Thus the above programs are building a simple application using Gradle successfully completed.
Exp No: 8
Install ansible and configure ansible roles and to write
Date: 29-10-24
playbooks.
AIM:
To Install Ansible and configure ansible roles and to write playbooks.
ALGORITHM:
Step 1: Install Ansible.
Step 2: Create Project Directory Structure.
Step 3: Define Target Hosts.
Step 4: Initialize a Role.
Step 5: Edit Role Tasks.
Step 6: Create an Ansible Playbook.
Step 7: Run the Playbook.
PROCEDURE:
1. Installing Ansible:
2. For Ubuntu/Debian:
sudo apt update
sudo apt install ansible
3. For CentOS/RHEL:
sudo yum install epel-release
sudo yum install ansible
4. For macOS:
brew install ansible.
5. For Windows:
You can use Windows Subsystem for Linux (WSL) or install Ansible in a Linux virtual machine.
Ansible Directory Structure.
Create a directory structure for your Ansible project.
Plaintext.
ansible_project/
|-- inventory/
| |-- hosts
|-- roles/
|-- playbooks/
|-- ansible.cfg
inventory: This directory contains your inventory file where you define the hosts you want to manage.
roles: This directory will hold your Ansible roles.
playbooks: This directory will contain your Ansible playbooks.
ansible.cfg: Ansible configuration file.
Writing an Ansible Role:
6. Inside the roles directory, create a new role:
ansible-galaxy init my_role.
This will create a basic directory structure for your role.
7. Writing an Ansible Playbook:
Create a playbook inside the playbooks directory. For example, create a file named my_playbook.yml.
name: My Ansible Playbook.
hosts: your_target_host_group.
become: yes
roles:
- my role
Replace your_target_host_group with the group of hosts defined in your inventory.
8. Running the Ansible Playbook:
Run the playbook using the following command.
ansible-playbook -I inventory/hosts playbooks/my_playbook.yml.
OUTPUT:
My Ansible Playbook
Gathering Facts=ok: [192.168.1.10]
my role : Install Apache =changed: [192.168.1.10]
PLAY RECAP
192.168.1.10 : ok=2 changed=1 unreachable=0 failed=0 skipped=0 rescued=0 ignored=0
RESULT:
Thus the above program Install Ansible and configure ansible roles and to write playbooks in successfully.