You are on page 1of 28

What is DevOps?

The word DevOps is a combination of two words Development and Operations. Before
getting into what DevOps is, let us get an idea about the two teams involved in software
development.

The development team is responsible for developing, designing, and building the
application.
The operation team deals with the deployment and testing of the application. If there are
problems with the application, the operation team also provides feedback to the development
team. Now let us get to the history of DevOps.

DevOps helps you to reduce the disconnection between software developers, quality
assurance (QA) engineers, and system administrators.

DevOps promotes collaboration between Development and Operations team to deploy code
to production faster in an automated & repeatable way.

DevOps helps to increase organization speed to deliver applications and services. It also
allows organizations to serve their customers better and compete more strongly in the market.

DevOps is all about the integration of the operations and development process. Organizations
that have adopted DevOps noticed a 22% improvement in software quality and a 17%
improvement in application deployment frequency and achieved a 22% hike in customer
satisfaction. 19% of revenue hikes as a result of the successful DevOps implementation.

Why DevOps?
Before going further, we need to understand why we need the DevOps over the other
methods.
o The operation and development team worked in complete isolation.
o After the design-build, the testing and deployment are performed respectively. That's
why they consumed more time than actual build cycles.
o Without the use of DevOps, the team members are spending a large amount of time on
designing, testing, and deploying instead of building the project.
o Manual code deployment leads to human errors in production.
o Coding and operation teams have their separate timelines and are not in synch,
causing further delays.
DevOps History

DevOps Advantages and Disadvantages


Here are some advantages and disadvantages that DevOps can have for business, such as:
Advantages
o Excellent approach for quick development and deployment of applications.
o It responds faster to the market changes to improve business growth.
o DevOps escalate business profit by decreasing software delivery time and
transportation costs.
o DevOps process gives clarity on product development and delivery.
o It improves customer experience and satisfaction.
o DevOps simplifies collaboration..
o DevOps means collective responsibility, for better team engagement and productivity.
Disadvantages
o DevOps professionals are less available.
o Developing with DevOps is expensive.
o Adopting new DevOps technology is hard to manage in short time.
o Lack of DevOps knowledge can be a problem in the continuous integration of
automation projects.
DevOps Architecture/pipeline/components or
stages

o Development and operations both play essential roles in order to deliver applications.
o DevOps architecture is the solution to fix the gap between deployment and operation
terms; therefore, delivery can be faster.

OR
A pipeline in software engineering team is a set of automated processes which allows
DevOps professionals and developer to reliably and efficiently compile, build, and deploy
their code to their production compute platforms.

The most common components of a pipeline in DevOps are build automation or continuous
integration, test automation, and deployment automation.

A pipeline consists of a set of tools which are classified into the following categories such as:
o Source control
o Build tools
o Containerization
o Configuration management
o Monitoring

Continuous Integration Pipeline


Continuous integration (CI) is a practice in which developers can check their code into a
version-controlled repository several times per day.
Automated build pipelines are triggered by these checks which allows fast and easy to locate
error detection.
Some significant benefits of CI are:
o Small changes are easy to integrate into large codebases.
o More comfortable for other team members to see what you have been working.
o Fewer integration issues allowing rapid code delivery.
o Bugs are identified early, making them easier to fix, resulting in less debugging work.
Continuous Delivery Pipeline
Continuous delivery (CD) is the process that allows operation engineers and developers to
deliver bug fixes, features, and configuration change into production reliably, quickly, and
sustainably.
Continuous delivery offers the benefits of code delivery pipelines, which are carried out that
can be performed on demand.
Some significant benefits of the CD are:

o Faster bug fixes and features delivery.


o CD allows the team to work on features and bug fixes in small batches, which means
user feedback received much quicker. It reduces the overall time and cost of the
project.

1) Plan
In this initial stage, product managers and owners gather requirements from stakeholders
and define the product roadmap. This is a crucial step to ensure productivity and easy
collaboration, as it is important to determine the characteristics and expectations of the
project to develop a plan that accomplishes the end goals.

Tools like Asana , Clickup

2) Code
After the tasks are understood and distributed, the team can choose the right tools for the
project. These tools will help the process be more fail-proof and automate the necessary
steps. We’ll discuss the tools you can use later in this blog.

tools used are Git, JIRA

3) Build
Code is committed to a shared repository, where developers will run builds and tests and get
alerts if something fails. Source code repositories provide a safe environment for developers
to ensure that the code works and is ready for the next stage.

tools used are maven, Gradle.

4) Test
After the pull request is accepted and the build stage is completed with no errors, it is tested
in a staging environment. As manual testing can increase errors and consume extra time,
automating this task increases productivity and improves code.

tools used are Selenium, PYtest


5) Release
It is time to release the tested code. This could mean pushing a Docker image into the
repository to deploy it later or marking the code as functional after testing it so it’s ready for
deployment.

tool used is Jenkins.

6) Deploy
The release is seamlessly deployed to the production environment. The top priority is to use
the right tools to maintain availability and improve user experience.

tools used are AWS, Docker.

7) Operate
Teams collect feedback and automatically scale the platform as needed. This process is now
improved in the DevOps architecture thanks to the collaboration between development and
operations, as they work together actively.

tools used are Kubernetes, open shift.

8) Monitor
A major priority in DevOps is observability, so monitoring is important in the DevOps
architecture diagram process. In this stage, the cycle is reviewed to avoid errors and make
improvements if necessary.

tools used are Nagios, elastic stack.

Continuous Integration Server (Jenkins, Bamboo, CruiseControl,

TeamCity, and others)

Source Control Tool (e.g., CVS, SVN, GIT, Mercurial, Perforce,

ClearCase and others)

Build tool (Make, ANT, Maven, Ivy, Gradle, and others)

Automation testing framework (Selenium, Appium,

TestComplete, UFT, and others)


DevOps Lifecycle/Practices
DevOps defines an agile relationship between operations and Development. It is a
process that is practiced by the development team and operational engineers
together from beginning to the final stage of the product.

1) Continuous Development
During this phase, project requirements are gathered and discussed with
stakeholders. It’s a continuous process where developers are required to code
whenever any changes occur in the project requirement or in case of any
performance issues.
Many companies prefer agile practices for collaboration and use Scrum, Lean, and
Kanban. GIT and Jira are the most popular ones.

2) Continuous Integration
In this phase, updated code or add-on functionalities and features are developed
and integrated into existing code. Furthermore, bugs are detected and identified in
the code during this phase, but it also includes unit testing, integration testing.

o
Tools Used: Jenkin, Bamboo, GitLab CI, Buddy, TeamCity, Travis, and CircleCI

3) Continuous Testing
This phase, where the developed software is continuously testing for bugs. For
constant testing, automation testing tools such as TestNG, JUnit, Selenium, etc
are used. Selenium does the automation testing, and TestNG generates the
reports. This entire testing phase can automate with the help of a Continuous
Integration tool called Jenkins.
4) Continuous Monitoring
the application’s functionality and features are monitored continuously to detect
system errors such as low memory, non-reachable server, etc. This process helps
the IT team quickly identify issues related to app performance and the root cause
behind it.
Tools Used: Nagios, Kibana, Splunk

5) Continuous Feedback
Customer behavior is evaluated regularly on each release to improve future
releases and deployments. Businesses can either opt for a structural or unstructured
approach to gather feedback.
Pendo is a product analytics tool used to collect customer reviews and insights.

6) Continuous Deployment
In this phase, the code is deployed to the production servers. Also, it is essential to
ensure that the code is correctly used on all the servers.

The continuous deployment includes configuration management to make the


deployment of code on servers accurate and smooth.
some popular tools which are used in this phase, such as Chef, Puppet, Ansible,
and SaltStack.
Containerization tools are also playing an essential role in the deployment
phase. Vagrant and Docker are popular tools that are used for this purpose.

7) Continuous Operations

Generally, developers are required to take the server offline to make the updates,
which increases the downtime and might even cost a significant loss to the
company. Eventually, continuous operation automates the process of launching the
app and its updates.
Tools Used: Kubernetes and Docker Swarm are the container orchestration tools
used
DevOps Workflow
DevOps workflow provides a visual overview of the sequence in which input is provided.

DevOps workflow allows the ability to separate and arrange the jobs which are top
requested by the users.

DevOps Principles
1. End to End Responsibility: DevOps team need to provide performance support until
they become the end of life.
2. Continuous Improvement: DevOps culture focuses on continuous improvement to
minimize waste & speeds up the growth of products or services offered.
3. Automate Everything: Automation of repetitive tasks is an essential principle of the
DevOps process.
4. Customer Centric Action: DevOps team must take customer-focused actions
5. Monitor and test everything: The DevOps team needs to have robust monitoring
and testing procedures.
6. Work as one team: All members needed to do is work as one team with complete
collaboration.

DevOps Architecture Features/ecosystem


Here are some key features of DevOps architecture, such as:

1) Automation: Automation of repetitive tasks can reduce time consumption, especially


during the testing and deployment phase.
2) Collaboration: The teams share their responsibilities and work closely in sync, which
in turn makes the deployment to production faster.
3) Integration: The integration phase is where the existing code is combined with new
functionality and then tested.
4) Configuration management: config files ensures the application to interact with
only those resources that are concerned with the environment in which it runs.
DevOps Tools
Here are some most popular DevOps tools with brief explanation shown in the below image,
such as:

1) Puppet:

● Definition: Puppet is a widely used DevOps tool facilitating quick and frequent
delivery of technological changes. It supports infrastructure management as
code, with features like versioning, automated testing, and continuous
delivery.
● Key Points:
● Real-time context-aware reporting.
● Manages the entire environment and enforces infrastructure
continually.
● Enables desired state conflict detection and remediation.
● Eliminates manual work in the software delivery process.
● Supports developers in delivering software quickly.

2) Ansible:

● Definition: Ansible is a leading DevOps tool, an open-source IT engine


automating application deployment, cloud provisioning, and intra-service
orchestration. It simplifies automation scaling and enhances productivity
without using agents.
● Key Points:
● Easy to deploy without agents or custom security infrastructure.
● Eliminates repetitive tasks and manages complex deployments.
● Accelerates the development process.

3) Docker:

● Definition: Docker is a high-end DevOps tool for building, shipping, and running
distributed applications on multiple systems. It facilitates quick assembly of
apps from components, particularly suitable for container management.
● Key Points:
● Configures systems faster.
● Increases productivity through isolated containers.
● Routes incoming requests for published ports to active containers.
● Allows saving secrets into the swarm.

4) Nagios:

● Definition: Nagios is a useful DevOps tool for error identification and


resolution through network, infrastructure, server, and log monitoring.
● Key Points:
● Provides complete monitoring of desktop and server operating
systems.
● Identifies bottlenecks and optimizes bandwidth utilization.
● Monitors services, applications, OS, and network protocol.
● Supports complete monitoring of Java Management Extensions.

5) CHEF:

● Definition: CHEF is a cloud-based, open-source DevOps tool using Ruby


encoding for infrastructure automation, reducing manual tasks through
recipes and cookbooks.
● Key Points:
● Maintains high availability and manages multiple cloud environments.
● Uses Ruby language for a domain-specific language.
● Doesn't assume the node's current status, using its mechanism for
state retrieval.

6) Jenkins:

● Definition: Jenkins is a DevOps tool for monitoring repeated task execution,


enabling continuous integration and efficient project change integration.
● Key Points:
● Increases automation scalability.
● Easily set up and configured via a web interface.
● Supports distribution of tasks across multiple machines.
● Offers 400+ plugins for building and testing projects.

7) Git:

● Definition: Git is an open-source distributed version control system for


efficient collaboration on projects of all sizes.
● Key Points:
● Supports distributed development and pull requests.
● Enables a faster release cycle.
● Scalable, secure, and completes tasks quickly.

8) SALTSTACK:

● Definition: SALTSTACK is a lightweight DevOps tool offering real-time error


queries and orchestration for the software-defined data center.
● Key Points:
● Eliminates messy configuration or data changes.
● Provides detailed tracing of web requests.
● Ensures secure access and configures image caches.

9) Splunk:

● Definition: Splunk makes machine data usable, accessible, and valuable for
operational intelligence in DevOps teams.
● Key Points:
● Next-generation monitoring and analytics solution.
● Delivers a unified view of different IT services.
● Extends with purpose-built solutions for security.

10) Selenium:

● Definition: Selenium is a portable software testing framework for web


applications, providing an interface for developing automated tests.
● Key Points:
● Supports multiplatform testing (Android, iOS).
● Easy to build keyword-driven frameworks for WebDriver.
● Creates robust browser-based regression automation suites and tests.

DevOps Automation
Automating everything is the fundamental principle of DevOps. It starts from the code
generation on the developers machine, until the code is pushed to the code and after that to
monitor the application and system in the production.

Automating infrastructure set up and configurations, and software deployment is the key
highlight to make deliveries over a few hours and make frequent deliveries across platforms.

Automation in DevOps boosts speed, consistency, higher accuracy, reliability, and increases
the number of deliveries.
Automation in DevOps encapsulates everything right from the building, deploying, and
monitoring.
DevOps Automation Tools
In large DevOps team that maintain extensive massive IT infrastructure can be classified into
six categories, such as:
o Infrastructure Automation
o Configuration Management
o Deployment Automation
o Performance Management
o Log management
o Monitoring
DevOps Engineers
DevOps Engineer is an IT professional who works with system operators, software
developers, and other production IT staff to administer code releases.

They understand the software development lifecycle and various automation tools for
developing digital pipelines.

They have hard as well as soft skills to communicate and collaborate with development,
testing, and operations teams.

They need to code occasionally from scratch, and they must have the basics of software
development languages.
They will work with development team staff to tackle the coding and scripting needed to
connect elements of code, like libraries or software development kits.
A bachelor's degree in computer science or related fields is generally required for DevOps
engineers & prefer those who have a master's degree and at least three to five years of work
experience in this field. HTTP, HTML, CSS, SSL, XML, Linux, Java, Amazon Web Services
(AWS), NoSQL technologies, DNS, and web app development.

DevOps Engineer Roles and Responsibilities


DevOps engineers work full time.
They are responsible for the production and continuing maintenance of a software application
platform.

o Manage projects effectively through an open standard based platform.


o Increases project visibility through traceability.
o Improve quality and reduce the development cost with collaboration.
o DevOps should have the soft skill of problem solver and a quick learner.
o Analyze, design, and evaluate automation scripts and systems.
o Able to perform system troubleshooting and problem-solving across the platform and
application domains.
o Ensuring the critical resolution of system issues by using the best cloud security
solution services.
DevOps Cloud Methodology
1. Teams: Focus on mission/project and cloud management teams.
2. Connectivity: Public, on-premise, and hybrid cloud network access.
3. Automation: Infrastructure as code, scripting for orchestration and
deployment.
4. On-boarding Process: How projects initiate in the cloud.
5. Project Environment: TEST, DEV, PROD setups.
6. Shared Services: Enterprise-provided common capabilities.
7. Naming Conventions: Essential for resource tracking and billing.
8. Standards Role Definition: Permissions based on job functions.

Azure DevOps
● Components: Azure Test Plans, Azure Boards, Azure Repos, Azure Pipeline,
Azure Artifacts.
● Azure Pipeline: Cloud-native CI server for building, testing, and deploying.
● Azure DevOps Server: Microsoft's product covering the entire application
lifecycle.
● Azure DevOps Services: SaaS offering, integrates with Visual Studio, free for
basic usage.

AWS DevOps
● Tools: AWS CloudFormation, EC2, CloudWatch, CodePipeline.
● CloudFormation: Templates for frequent cloud instance and service creation.
● EC2: Run containers with AWS security and management features.
● CloudWatch: Monitoring tool for tracking AWS resources.
● CodePipeline: Simplifies CI/CD toolset management, integrates with Jenkins,
GitHub, CodeDeploy.

DevOps Training Certification


● Red Hat Certification: Ansible automation, Platform-as-a-service, Container
Administrator, Configuration Management, Containerized Application
Development.
● AWS Certification: DevOps patterns on AWS, focuses on core DevOps
principles.
● DevOps Institution: Global learning community, offers various certifications.
DevOps vs Agile
● DevOps: Combination of development and operations, focuses on
collaboration, automation, and faster application delivery.
● Agile: Iterative development and testing, emphasizes incremental and
evolutionary development, core values include working software,
responsiveness to change, customer collaboration.

Below are some essential differences between the DevOps and Agile:
Waterfall Model:

It’s Challenges:
Summary

What is DevOps?
DevOps is a software development and IT operations process that helps to improve the
collaboration between developers and operators by automating the Deployment,
configuration, monitoring, and management of applications.
Why Need/Learn DevOps?
The benefits of learning DevOps include:

● Improved Quality: DevOps can help ensure that your applications are delivered on
time and with high quality, and it can also help reduce the number of errors and
defects in your code.
● Faster Development Processes: With DevOps in place, you can deploy new features
faster and more efficiently. It will help you release new versions of your applications
more frequently, leading to a higher level of customer satisfaction.
● Increased Agility: DevOps quickly respond to changes in the market or regulatory
environment. This will enable you to stay ahead of the competition and maintain a
leadership position in your field.
● Reduced risk: Operators can take over specific tasks or processes previously handled
by developers, leading to a decrease in the number of errors and increased efficiency.
● Improved communication: When developers and operators work together closely,
they can identify problems early on and make necessary changes before they become
major issues.
Applications of DevOps
Here are essential Applications of DevOps:

● Online Financial Trading Company


● Use of DevOps in Network cycling
● Application in Car Manufacturing Industries
● Benefits to Airlines Industry
● It helps to decrease Computation Cost and Operation Time
● Able to provide a better quality of applications to their customers
● DevOps helps in faster delivery of applications
● Used in United Airlines, HP , KeyBank, Amazon, Netflix, Adobe
Version Control System
● A version control system is a software that tracks changes to a file or set of files over time so
that you can recall specific versions later.
● It also allows you to work together with other programmers.
● It is a collection of software tools that help a team to manage changes in a source code.
● It keep track of every modification to the code.
● Developers can compare earlier versions of the code with an older version to fix the mistakes.

Benefits of the Version Control System


o Complete change history of the file
o Simultaneously working
o Branching and merging
o Traceability

Types of Version Control System


o Localized version Control System
o Centralized version control systems
o Distributed version control systems

Localized Version Control System:


A version control system where each developer has their own local repository,
managing changes and versions independently. It lacks centralized coordination and
is suitable for individual projects.
The major drawback of Local VCS is that it has a single point of failure.
Advantages:

● Simplicity
● Isolation
● Speed

Limitations:

● Collaboration Challenges
● Limited History
Centralized Version Control Systems:
A version control system where each developer has their own local repository,
managing changes and versions independently. It lacks centralized coordination and
is suitable for individual projects.
It also has the same drawback as in local version control system that it also has a
single point of failure.
Advantages:

● Collaboration
● Version Tracking
● Access Control

Limitations:

● Single Point of Failure


● Network Dependency

Distributed Version Control Systems:


A version control system where each user has a complete copy of the repository,
allowing for offline work and redundancy. Developers can work independently, and
the system excels in efficient branching and merging, reducing reliance on a central
server.
they have a steep learning curve
Advantages:

● Offline Work
● Redundancy
● Efficient Branching

Limitations:

● Learning Curve
● Complexity
What is Git?
Git is an open-source distributed version control system.
It is designed to handle minor to major projects with high speed and efficiency.
It is developed to co-ordinate the work among the developers.
It allows us to track and work together with our team members at the same workspace.

Git was created by Linus Torvalds in 2005 to develop Linux Kernel. It is also used as an important
distributed version-control tool for the DevOps.

Git is foundation of many services like GitHub and GitLab, but we can use Git without using any
other Git services. Git can be used privately and publicly.
3 stage architecture/workflow of git:

The Git workflow is divided into three states:


● Working directory - Modify files in your working directory
● Staging area (Index) - Stage the files and add snapshots of them to your staging area
● Git directory (Repository) - Perform a commit that stores the snapshots permanently to your
Git directory. Checkout any existing version, make changes, stage them and commit.

Benefits of Git:
Saves Time: Git is lightning fast technology. Each command takes only a few seconds to execute
Offline Working: One of the most important benefits of Git is that it supports offline working.
Undo Mistakes: One additional benefit of Git is we can Undo mistakes.
Track the Changes: Git facilitates with some exciting features such as Diff, Log, and Status,
which allows us to track changes so we can check the status, compare our files or branches.
Everything is Local
Collaborate to Public Projects
Git Integrity: Git is developed to ensure the security and integrity of content being version
controlled.
Impress Recruiters: We can impress recruiters by mentioning the Git and GitHub on our resume.

Commands in Git:
Create Repositories: git init
Make Changes:
add
commit
status
Parallel Development:
branch
merge
rebase
Sync Repositories:
push
pull
add origin
What is Jenkins?
Jenkins is an open source(Apache Software Foundation) automation server. It is designed to build, test
and deploy software projects by automating all of the tedious or time consuming phases of a software
project.
It requires a web server like Apache Tomcat to run on various platforms like Windows, Linux,
macOS, Unix, etc.
It runs on any operating system that supports Java Virtual Machine (JVM), including Windows,
Linux, Mac OS X and Solaris.
Ease of use and extensibility. It can be used with any programming language
or platform such as PHP or Ruby on Rails with no configuration required other
than installing Jenkins itself.

It provides a virtual machine for executing builds (runs), automatic testing of


code before it goes live and a web interface to view the results.

3 stage architecture/workflow of git:

3 Key Components of Jenkins Architecture are:


● Jenkins Master : The Jerkins master server is responsible to hold all key configurations. It
handles Sending builds to slaves for actual execution, Monitor slaves (go online and offline as
needed), Recording and presentation results, A master instance of Jenkins can also run build
jobs directly.

● Jenkins Agent Nodes : They are the worker nodes that actually perform all the
steps mentioned in a job. They are assigned to a job when you create it and they run
the actual tasks.
You
can run jobs on the Jenkins server without an agent, but then Master nodes will act
as agents.
You can attach any number of Jenkins agents to a master using a combination
of Windows, Linux, and even container servers as build agents.
Depending on the application, you can also limit execution to specific agents.
For example: if you have an agent with Java 8 configurations, you can assign jobs
that require a Java 8 environment to those agents.

● Jenkins Web Interface : Jenkins 2.0 introduced a new web interface called “Jenkins Blue
Ocean”. It has a good visual representation of all pipelines

Jenkins Slave
A Slave is a Java executable file that runs on a remote machine.
to hear the requests from jenkins master, and do job as specified & can run different OS

You can configure a project to always run on a particular Slave machine or type of
Slave machine, or you can just let Jenkins choose the next available Slave.

Adv. of Jenkins:
● Highly extensible with a wide variety of existing plugins.
● Robust and reliable at almost any scale.
● Supports hybrid and multi-cloud environments.
● Extensive documentation and community resources.
● Based on Java, making it suitable for legacy enterprise environments.

Disadv. of Jenkins:

● Single server architecture—uses a monolithic architecture, which limits


resources to resources on a single computer, virtual machine, or container.
● Jenkins sprawl– Multiple teams using Jenkins can create a large number of
standalone Jenkins servers that are difficult to manage.
● Relies on dated Java architectures and technologies—specifically Servlet and
Maven. In general, Jenkins uses a monolithic architecture and is not designed
for newer Java technologies such as Spring Boot or GraalVM.
● Not container native—Jenkins was designed in an era before containers and
Kubernetes gained popularity, and while it supports container technology,
● Groovy expertise requirements—Jenkins has programmatic pipelines
implemented in Groovy,

Run the command java -jar jenkins. war


Browse to http://localhost:8080
Jenkinsfile (Declarative Pipeline) : A Jenkinsfile is a text file that contains the definition
of a Jenkins Pipeline and is checked into source control.

The Jenkinsfile typically includes stages like:


● Checkout: Retrieve source code from the version control system.
● Build: Compile the code and perform unit tests.
● Test: Run additional tests such as integration or functional tests.
● Deploy: Deploy the application to a staging environment.
● Deploy to Production: Deploy the application to the production environment
(optional).

Building Delivery Pipeline:

A delivery pipeline automates the process of moving code changes from development through testing
to deployment.

Steps:
1. Define stages in the pipeline (e.g., build, test, deploy).
2. Configure triggers to initiate the pipeline.
3. Set up automated testing at each stage.
4. Deploy to different environments based on success.

Jenkins Pipeline Implementation:

1. Install Jenkins: Install Jenkins and required plugins.


2. Create Pipeline: Set up a new pipeline job.
3. Write Jenkinsfile: Create a concise Jenkinsfile in your code repository.
4. Run Pipeline: Execute the pipeline job in Jenkins.
5. Customize: Tailor the Jenkinsfile to your project.
6. Visualize with Blue Ocean: Use Blue Ocean for enhanced visualization.
7. Configure Notifications: Set up notifications for alerts.
Adding a Slave Node to Jenkins:
A slave node is an additional machine that can be utilized to offload Jenkins build tasks from the
master.

On the Jenkins Master:

1. Navigate to Nodes Configuration:


a. Go to "Manage Jenkins" > "Manage Nodes and Clouds."
2. Create a New Node:
a. Click "New Node" or "New Dumb Node."
3. Configure Node Basics:
a. Enter a name, choose "Permanent Agent," and save.
4. Configure Node Details:
a. Set executors, remote directory, and labels.
5. Choose Launch Method:
a. Select launch method based on your environment.
6. Save Node Configuration.

On the Jenkins Slave Machine:

1. Prepare the Slave Machine:


a. Ensure Java is installed.
b. Download agent.jar from the Jenkins master.
2. Run Agent on Slave:
a. Open a terminal, navigate to the directory, and run the agent.
3. Verify Connection:
a. Check the Jenkins master to confirm the node is online.

Confirm Configuration:

​ Test a Build:
● Create a job and configure it to run on the new node.
​ Build Execution:
● Start the build to verify successful execution on the slave node.
Create a Pipeline Script to Deploy an Application over the Tomcat Server:
Using Jenkins pipeline script to automate the deployment of an application on a Tomcat server.

Steps:
1. Define pipeline stages (checkout, build, test, deploy).
2. Write script to deploy the application to Tomcat.
3. Utilize Tomcat manager or deploy directly to the server.

pipeline {
agent any
environment {
TOMCAT_HOME = "/path/to/tomcat"
WAR_FILE = "your-application.war"
}

stages {

stage('Checkout') {
steps {
// Assuming you are using Git for version control
checkout scm
}
}

stage('Build') {
steps {
// Assuming you use Maven for building
sh 'mvn clean install'
}
}

stage('Deploy to Tomcat') {
steps {
sh "cp target/${WAR_FILE} ${TOMCAT_HOME}/webapps/"
sh "${TOMCAT_HOME}/bin/shutdown.sh"
sh "${TOMCAT_HOME}/bin/startup.sh"
}
}
}
}

Replace "/path/to/tomcat" with the actual path to your Tomcat installation, and
"your-application.war" with the name of your WAR file.
INTRO TO Apache MAVEN
Maven, a Yiddish word meaning accumulator of knowledge, began as an attempt to simplify the
build processes in the Jakarta Turbine project. Maven is a powerful project management
tool that is based on POM (project object model) containe (project, .

It is used for projects build, dependency and documentation.

Current version of Maven is 3.

Apache Maven helps to manage

○ Builds
○ Documentation
○ Reporing
○ SCMs
○ Releases
○ Distribution

A maven repository is a directory of packaged JAR file with pom.xml file. Maven
searches for dependencies in the repositories. There are 3 types of maven repository
Maven searches for the dependencies in the following order:

1. Local Repository
2. Central Repository
3. Remote Repository
CI vs CD: Continuous Integration (CI) is an approach of testing each change & integrate their work at
least once a day to codebase automatically to detect errors ,
whereas Continuous Delivery (CD) is an approach team develops software products in a short cycle
to perform changes of new features, configuration, and bug fixes.

Difference between Compilation and Continuous Integration ?


Compilation is the process the computer takes to convert a high-level
programming language code into a machine language that the
computer able to understand. It ensures a code compiler on every
target platform.

While compilation only compiles a code, CI does the following activities


DB integration
Code inspection
Automated Deployment
Document generation
Ex : Teamcity, Bamboo, Jenkins

What steps are in continuous integration?

​ Code Changes: Developers makes and commit change from IDE or CMD.
​ Trigger Build: Automatic build on commit , Build Code is compiled and tested.
​ Deployment:Successful builds deployed, Team receives build status.
​ Feedback Loop: Immediate feedback for developers, if failed.
Nokia used to implement a procedure called nightly build. After multiple commits from diverse
developers during the day, the software built every night.
Since the software was built only once in a day, it’s a huge pain to isolate, identify,
and fix the errors in a large codebase.

Later, they adopted the Continuous Integration approach. The software


was built and tested as soon as a developer committed code. If any
error is detected, the respective developer can quickly fix the defect.

Advantages of CI:

● Allows you to maintain just a single source repository


● You can test the clone of the production CI environment
● The built environment should be close to the production environment.
● One of the advantages of continuous integration is Constant availability of a current build
● The complete process of build and testing and deployment should be visible to all the
stakeholders.

Disadvantage of CI:
● Initial setup time and training is required to get acquainted with Cl server
● Development of suitable test procedures is essential
● Well-developed test-suite required many resources for Cl server
● Conversion of familiar processes
● Requires additional servers and environments
● Waiting times may occur when multiple developers want to integrate their code around the
same time

Best practices of using CI Systems

1. Commit Early and Commit Often never Commit Broken Code


2. Fix build failures immediately
3. Act on metrics
4. Build-in every target environment Create artifacts(human-like rep.) from every build
5. The build should carried out in a manner so that it can be automated
6. Do not depend on an IDE

You might also like