Naan Mudhalvan Devops
Naan Mudhalvan Devops
DEVOPS BY INFOSYS
Name :
Reg.No :
Department :
Year/Sem :
KARPAGA VINAYAGA
COLLEGE OF ENGINEERING & TECHNOLOGY
(Approved by AICTE, Accrediated by NBA & Affiliated to Anna University)
Madhuranthagam(Tk), Kancheepuram(Dt).
BONAFIDE CERTIFICATE
REGISTER NUMBER:
in..................................................................................................................... in the
….............................................................................laboratory
During the year …………………………………
Date:
Installation of Jenkins
4
Installation of SonarQube
5
AIM:
The aim is to understand the fundamentals of Agile methodology, including its values,
principles, and frameworks, and to compare it with traditional software development models.
SOFTWARE REQUIREMENTS:
• No specific software tools are required, as this experiment is theoretical.
• Access to course materials on the Infosys Springboard program.
• Optionally, Agile practice tools like Jira or Trello may be used for demonstration
purposes if available.
PROCEDURE:
1. Course Introduction
o The course outline was reviewed to understand the topics covered on Agile
methodology and software engineering basics.
o The educators in the course videos were introduced, with their areas of expertise
and teaching approaches noted.
1
ARUNAI ENGINEERING COLLEGE
2. Software Engineering Basics
o The Need for Software Engineering was studied to understand the purpose and
activities involved in creating reliable software.
o The concept of a software crisis was examined, which led to the development of
software engineering.
o Various traditional SDLC (Software Development Life Cycle) models were
reviewed, and the roles involved in a software team were discussed.
2
4. Agile Manifesto
o The reasons for the rise of the Agile approach in IT were explored, with emphasis
on its four core values and 12 guiding principles.
o Understanding was reinforced through a quiz on Values and Principles of Agility.
5. Agile Frameworks
o Several Agile frameworks, including Scrum and Kanban, were studied to
understand how Agile can be adapted to various project needs.
o FAQs on Agile methods were reviewed, providing insights on applying each
framework based on different project requirements.
6. Traditional vs Agile
o A comparison between traditional SDLC methods and Agile was conducted,
focusing on how Agile evolved and the flexibility it offers, especially for rapid
delivery.
3
7. Gamification of Scrum and Kanban Activities
o Practical demonstrations of Agile principles were observed through activities
such as the Agility in Sprints - Airplane Activity and Kanban Coin Activity.
8. Summary
o A concluding quiz and assessment were completed to validate the understanding
of Agile methodology concepts.
THEORY AND APPLICATION:
Agile methodology is a software development approach that emphasizes flexibility,
customer collaboration, and incremental delivery. Instead of following rigid planning,
Agile prioritizes responding to changes, allowing software to be produced more quickly and
to adapt to client needs. The Agile Manifesto introduced four values: prioritizing individuals
and interactions over processes and tools, working software over comprehensive
documentation, customer collaboration over contract negotiation, and adapting to change
over following a strict plan.
In practical application, Agile frameworks such as Scrum and Kanban are widely utilized.
Scrum operates with iterative sprints, each delivering a potentially shippable product
increment. Kanban, on the other hand, visualizes work and manages flow by limiting work-
in-progress, promoting continuous improvement.
RESULT:
4
Exp no: 2 Continuous Integration and Continuous Delivery
Date:
AIM:
The aim is to understand the principles of Continuous Integration and Continuous Delivery
(CI/CD) in DevOps, including the technology, people, and process aspects, along withpractical
implementation using Java and an open-source tool stack.
SOFTWARE REQUIREMENTS:
• Java Development Kit (JDK)
• Git for version control
• SonarQube for static code analysis
• JUnit for unit testing and code coverage
• Maven for build automation
• Docker for containerization
• A CI/CD tool (e.g., Jenkins)
PROCEDURE:
1. Prelude
o Pre-requisites for the course were reviewed, including the background
knowledge required.
o The learning outcomes were noted, providing an overview of what would be
achieved in this course.
o A case study was introduced, which would be referenced throughout the course
to contextualize DevOps concepts.
5
2. Fundamentals of DevOps
o Definitions of DevOps were explored, including popular industry perspectives
on the concept.
o A quiz was completed to evaluate understanding of DevOps fundamentals.
6
o Various tool stacks and their implementation in DevOps were studied.
o The orchestration steps involved in Continuous Integration and Continuous
Delivery were examined, followed by a quiz on CI/CD concepts.
o People and process aspects were discussed, focusing on the roles and
responsibilities of team members in a DevOps environment.
7
o The process of continuous delivery and deployment to staging and production
environments was explored.
o Containerization was explained to demonstrate its role in hassle-free deployment
across multiple environments.
o The concept of gating in a CI/CD pipeline was introduced, describing types and
methods of gating conditions.
8
6. Practice Exercises
o Practice exercises were provided as a guide, with step-by-step instructions for
constructing an automated continuous integration pipeline.
o The course concluded with a self-assessment to evaluate the understanding of
continuous integration and delivery concepts in DevOps.
RESULT:
Hence the understanding of the principles of Continuous Integration
and Continuous Delivery (CI/CD) in DevOps, including the technology, people,
and process aspects, along with practical implementation using Java and an open-
source tool stack have been verified and executed and successfully.
9
Exp no: 3 Building of CI-CD Pipelines in Jenkins
Date:
AIM:
The aim of this experiment is to build an understanding of Continuous Integration and
Continuous Deployment (CI/CD) pipelines using Jenkins, along with their benefits and
application in DevOps.
SOFTWARE REQUIREMENTS:
• Jenkins
PROCEDURE:
Step 1: Login into your Jenkins account as shown below.
Step 2. Once logged in, the user will be redirected to the Jenkins console, here‟s the
reference for the same.
Step 3:
To create a new project, select the option available in the Dashboard which is “New
Item” Refer to the image provided below:
10
Step 4:
Now a list of options will be visible on the screen, along with a field to name the pipeline.
Add a suitable name and select the “Pipeline” option to proceed. Refer to this screenshot.
Step 5:
Once redirected, the configuration page will appear. This is the most important page as here
all the details will be filled in. At first, there is the General section where the user can add a
description based on the project for which the pipeline has to be created. And establish the
11
connection to compute from where the pipeline will access the project. Refer to the
screenshot to understand better.
Step 6:
Now comes the second section, i.e. “Build triggers”. Here, we need to specify the branch and
repository and give the credentials too. And add additional behaviours if required so far.
Refer to the screenshot to have a better understanding.
Step 7:
The next section is “Advanced Project Options”, as the name suggests it is related to thespecial
pipelines only, simpler projects do not require any specifications in this section. Please refer to
the screenshot given below for the same.
12
Step 8:
This is the last section i.e. “Pipeline”. Here the user specifies from where the scripts will be
imported including the path to the file, repository, credentials, etc. Refer to the screenshot
attached below for reference.
Sample Pipeline script To Deploy the Web Application Into The Tomcat Server
node
{
//Mention the tools which have been configured
13
// Mention how to trigger the Pipeline and how many Builds must be there and so on
properties([buildDiscarder(logRotator(artifactDaysToKeepStr:
'', artifactNumToKeepStr: '5', daysToKeepStr: '
', numToKeepStr: '5')), pipelineTriggers([pollSCM('* * * * *')])])
stage('checkout code'){
git branch: 'development', credentialsId: '*******', url: '********'
}
stage('build'){
sh "${mavenhome}/bin/mvn clean package"
}
stage('execute sonarqube package'){
sh "${mavenhome}/bin/mvn clean sonar:sonar"
}
stage('upload buildartifact'){
sh "${mavenhome}/bin/mvn clean deploy"
}
stage('tomcat'){
sshagent(['myuser']) {
sh "scp -o StrictHostKeyChecking=no target
/maven-web-application.war ec2-user@myuser:/opt/apache-tomcat-9.0.64/webapps/
}
}
14
Step 9:
After writing the pipeline is done click on save it will be directly redirected to the Dashboard
of the project there we can use, the “Build Now” option to run the pipeline and check if it is
successful or not, by using stage view or console output.
We can see the outcome of the pipeline in the stage view where as shown in the image
below.
15
And we can also see the console output where we can see logs of each and every step which
is performed.
Click on the console output to see the logs of each and every stage that is performed by using
the pipeline.
16
Scroll down to the end of the console output there we can see the status of the pipeline if it
is “Finished: success” The pipeline which we have written was a success. If it marks as a
fail we see the logs in the console we can find the reason why the stage was getting failed.
THEORY AND APPLICATION:
DevOps professionals rely on pipelines to automate stages such as building, testing, and
deploying applications. Manually handling these tasks via a user interface consumes
significant time and can impact productivity. By using CI/CD pipeline scripts, teams can
automate these processes, boosting productivity, minimizing errors, and enhancing delivery
speed. CI/CD pipelines help to deliver high-quality applications efficiently to end users.
What is a CI/CD Pipeline?
A CI/CD pipeline, short for Continuous Integration / Continuous Deployment, is a
structured, automated process that enables seamless integration and deployment of code
changes. In a CI/CD pipeline, multiple stages are linked to create a processing system where
each stage receives input, processes it based on predefined rules, and passes it on to the next
stage. This linear flow, in which each stage depends on the successful completionof the
previous stage, ensures stability and efficiency in application delivery. A typical CI/CD
pipeline includes steps like testing code, building the application, pushing to a repository, and
deploying to a server.
Each step occurs sequentially, and if any stage fails, subsequent steps halt until the error is
resolved, ensuring quality is maintained at every stage. The Devops Engineering – Planning
to Production course is a valuable resource, offering real-world examples and best practices
for setting up and optimizing CI/CD pipelines using Jenkins.
17
What is Continuous Integration (CI)?
Continuous Integration (CI) is the practice of automatically building and testing code
whenever changes are pushed to a repository, such as GitHub or GitLab. This automation
ensures that code remains functional and meets standards before being merged into a shared
repository, allowing for rapid detection of issues and increased development speed.
Continuous Delivery
Continuous Delivery enables teams to deliver builds into production with minimal human
intervention. Every build that passes all automated tests can be deployed into production with
just a single click, allowing for a rapid and efficient release process while maintaining high
quality.
RESULT:
18
Exp no: 4 Installation of Jenkins
Date:
AIM:
To successfully install Jenkins, a popular open-source automation server, to facilitate
continuous integration and continuous deployment (CI/CD) processes.
SOFTWARE REQUIREMENTS:
• Java: Jenkins requires Java to run. Ensure you have Java Development Kit (JDK)
version 8 or higher installed.
• Web Browser: A modern web browser for accessing the Jenkins web interface.
• Operating System: Jenkins can be installed on various operating systems including
Windows, macOS, and Linux.
• Minimum Hardware Requirements: RAM: 256 MB (1 GB recommended for better
performance).Disk Space: 1 GB (10 GB recommended for Docker
installations).Recommended Hardware Configuration: RAM: 4 GB or more, Disk Space:
50 GB or more
PROCEDURE FOR INSTALLATION:
Step 1: Setup wizard
On opening the Windows Installer, an Installation Setup Wizard appears, Click Next on
the Setup Wizard to start your installation.
19
Step 2: Select destination folder
Select the destination folder to store your Jenkins Installation and click Next to continue.
20
Step 4: Port selection
Specify the port on which Jenkins will be running, Test Port button to validate whether the
specified port if free on your machine or not. Consequently, if the port is free, it will show a
green tick mark as shown below, then click on Next.
21
Step 6: Custom setup
Select other services that need to be installed with Jenkins and click on Next.
22
Step 8: Finish Jenkins installation
Once the installation completes, click on Finish to complete the installation.
Jenkins will be installed as a Windows Service. You can validate this by browsing
the services section, as shown below:
23
This setup wizard takes you through a few quick "one-off" steps to unlock Jenkins, customize
it with plugins and create the first administrator user through which you can continue
accessing Jenkins.
Unlocking Jenkins
When you first access a new Jenkins controller, you are asked to unlock it using an
automatically-generated password.
Step 1
Browse to http://localhost:8080 (or whichever port you configured for Jenkins when
installing it) and wait until the Unlock Jenkins page appears.
Step 2
The initial Administrator password should be found under the Jenkins installation path (set
at Step 2 in Jenkins Installation).
For default installation location to C:\Program Files\Jenkins, a file
called initialAdminPassword can be found under C:\Program Files\Jenkins\secrets.
However, If a custom path for Jenkins installation was selected, then you should check that
location for initialAdminPassword file.
24
Step 3
Open the highlighted file and copy the content of the initialAdminPassword file.
Step 4
On the Unlock Jenkins page, paste this password into the Administrator password field
and click Continue.
Notes:
• You can also access Jenkins logs in the jenkins.err.log file in your Jenkins directory
specified during the installation.
• The Jenkins log file is another location (in the Jenkins home directory) where the
initial password can also be obtained.
25
This password must be entered in the setup wizard on new Jenkins installations before you can
access Jenkins‟s main UI. This password also serves as the default administrator account‟s
password (with username "admin") if you happen to skip the subsequent user- creation step in
the setup wizard.
DASHBOARD OF JENKINS:
RESULT:
26
Exp no: 5 Installation of SonarQube
Date:
AIM:
To successfully install SonarQube, an open-source platform for continuous inspection of code
quality, enabling teams to manage code quality and security in their software development
projects.
SOFTWARE REQUIREMENTS:
• Java JDK: SonarQube requires Java 11 or later. Ensure that JDK is installed and
configured properly.
• Database: SonarQube requires a database to store analysis results. Supported
databases include:
• PostgreSQL (recommended)
• MySQL
• Oracle
• Microsoft SQL Server
• Web Browser: A modern web browser for accessing the SonarQube web interface.
Minimum Hardware Requirements
• RAM: 2 GB (4 GB recommended for better performance).
• Disk Space: 1 GB (more depending on the size of the projects).
Recommended Hardware Configuration
• RAM: 8 GB or more.
• Disk Space: 20 GB or more.
Step 1: Download and Install Oracle Java 17
Before installing SonarQube, ensure you have Java installed. Follow these steps:
1. Download Oracle Java 17 from Oracle‟s website.
2. Run the downloaded installer and follow the installation wizard.
3. Set the JAVA_HOME environment variable to C:\Program Files\Java\jdk-17\bin.
Step 2: Download and Install SonarQube
27
Now, let‟s install SonarQube:
1. Download the SonarQube zip file from SonarSource.
2. Extract the contents of the zip file to C:\sonarqube-10.4.1.88267.
3. Set the SONAR_JAVA_PATH environment variable using CMD:
set "SONAR_JAVA_PATH=C:\Program Files\Java\jdk-17\bin\java.exe"
28
C:\sonar-scanner-5.0.1.3006-windows\bin\sonar-scanner.bat -
D"sonar.projectKey=myproject" -D"sonar.sources=." -
D"sonar.host.url=http://localhost:9000" -D"sonar.login=<your_token_here>"
Replace myproject with your project key and <your_token_here> with your generated token
from SonarQube.
Step 7: Create and Analyze a Project in SonarQube
1. Log in to SonarQube dashboard.
2. Navigate to Projects tab > Create Project.
29
Theory and Application
• Theory: SonarQube is a tool that enables developers to continuously inspect thequality
of code. It provides reports on code smells, bugs, vulnerabilities, and coverage metrics,
helping teams maintain high code quality.
• Application: It is widely used in software development environments to integrate quality
checks into the CI/CD pipeline. SonarQube can analyze multiple programming
languages and integrates with various CI tools like Jenkins, GitLab CI, and more.
RESULT:
30
Exp no: 6 Installation of Eclipse IDE
Date:
AIM:
To successfully install Eclipse IDE, a popular open-source integrated development
environment (IDE) used for Java development and other programming languages.
SOFTWARE REQUIREMENTS:
Prerequisites
• Java Development Kit (JDK): Eclipse requires Java to run. Ensure you have JDK
version 11 or higher installed.
• Operating System: Eclipse can be installed on various operating systems including
Windows, macOS, and Linux.
Minimum Hardware Requirements
• RAM: 4 GB (8 GB recommended for better performance).
• Disk Space: 1 GB (more depending on the number of plugins and projects).
Recommended Hardware Configuration
• RAM: 8 GB or more.
• Disk Space: 5 GB or more.
PROCEDURE:
5 Steps to Install Eclipse
31
security warning to run this file. If the Eclipse Foundation is the Publisher, you are good to
select Run.
For Mac and Linux users, you will still need to unzip the download to create the Installer.
Start the Installer once it is available.
32
4. Select your installation folder
Specify the folder where you want Eclipse to be installed. The default folder will be in your
user directory. Select the „Install‟ button to begin the installation.
5. Launch Eclipse
Once the installation is complete you can now launch Eclipse. The Eclipse Installer has
done it's work.
33
Theory and Application
• Theory: Eclipse IDE is a powerful tool that provides a comprehensive environment
for software development. It supports multiple programming languages through
plugins and offers features like code completion, debugging, and version control
integration.
• Application: Eclipse is widely used in the industry for Java development, but it also
supports other languages such as C/C++, PHP, and Python through various plugins.
It is especially popular for developing enterprise applications, Android apps, and web
applications.
RESULT:
34
Exp no: 7 Calculator App in Java using Eclipse IDE
Date:
AIM:
To create a simple calculator application in Eclipse using Java Swing, capable of performing
basic arithmetic operations (addition, subtraction, multiplication, and division).
SOFTWARE REQUIREMENTS:
• Java Development Kit (JDK)
• Eclipse IDE
• Java Swing Library
PROCEDURE:
1. Setup and Configuration:
o Open Eclipse IDE and create a new Java Project.
o Name the project as desired (e.g., "CalculatorApp") and set up the workspace.
o Inside the project, create a new Java class named Calculator.
35
import javax.swing.*;
import java.awt.*;
import java.awt.event.*;
3. Initialize Components:
36
5. Add Components to Frame:
o Add the panel containing number and operation buttons to the frame.
o Set the frame‟s properties (size, visibility, layout) and make it visible for
interaction.
6. Run and Test:
o Compile and run the program in Eclipse.
o Test each function to ensure buttons respond correctly and calculations are accurate.
37
2. User Interface Elements:
o Display Field: A non-editable JTextField to show the current input and
calculation results.
o Number and Operation Buttons: Buttons are created for numbers (0-9) and
basic arithmetic operations (+, -, *, /), alongside buttons for decimal input (.),
equals (=), clear (C), delete (Del), and negation ((-)).
o Event Handling: Implements ActionListener to handle button clicks, capture
inputs, and perform calculations based on the selected operation.
RESULT:
Hence To create a simple calculator application in Eclipse using Java Swing,
capable of performing basic arithmetic operations (addition, subtraction,
multiplication, and division) have been verified and executed successfully.
38