Devops Lab Manual
Devops Lab Manual
SEMESTER :
AGNI COLLEGE OF TECHNOLOGY
(Approved by AICTE& Affiliated to Anna University)
Old Mahabalipuram Road, Thalambur, Chennai – 600 130
BONAFIDE CERTIFICATE
Register Number :
TABLE OF CONTENT
Ex. No: 1
Date : Create Maven Build Pipeline in Azure
AIM:
The aim is to create a Maven Build pipeline in Azure DevOps. This
pipeline will automate the process of building and packaging a Java
project using Maven.
ALGORITHMS:
lOMoAR cPSD| 28043727
PROGRAM:
Yaml
- master
pool:
vmImage: 'ubuntu-latest'
steps:
- task:
MavenAuthenticate@0
inputs:
mavenServiceConnection: 'YourMavenServiceConnection'
mavenPomFile: 'path/to/your/pom.xml'
options: '-Xmx3072m'
- task: Maven@3
inputs:
mavenPomFile: 'path/to/your/pom.xml'
goals: 'clean package'
options: '-Xmx3072m'
lOMoAR cPSD| 28043727
OUTPUT:
The output of the pipeline will be displayed in the Azure DevOps pipeline execution
logs. It will include information about each step of the build process, such as Maven
dependencies resolution, compilation, testing, packaging, and any other configured
goals.
RESULT:
Upon successful execution of the pipeline, a packaged artifact (e.g., JAR file)
generated by Maven. This artifact can be deployed to other environments for
further testing or production use.
lOMoAR cPSD| 28043727
Ex. No: 2
Date : Run regression tests using Maven Build pipeline in Azure
AIM:
The aim is to extend the Maven Build pipeline created earlier to include the execution of
regression tests. This will ensure that the automated tests are integrated into the
continuous integration process.
ALGORITHM:
lOMoAR cPSD| 28043727
PROGRAM:
Yaml
Updated Azure DevOps YAML configuration for Maven Build Pipeline with
Regression Tests
trigger:
- master
pool:
vmImage: 'ubuntu-latest'
steps:
- task:
MavenAuthenticate@0
inputs:
mavenServiceConnection: 'YourMavenServiceConnection'
mavenPomFile: 'path/to/your/pom.xml'
options: '-Xmx3072m'
- task: Maven@3
inputs:
mavenPomFile: 'path/to/your/pom.xml'
goals: 'clean package test'
options: '-Xmx3072m
lOMoAR cPSD| 28043727
OUTPUT:
The output of the pipeline will now include the results of the regression tests.
Test reports, logs, and any failures will be displayed in the Azure DevOps pipeline
execution logs.
RESULT:
Ex. No: 3
Date : Install Jenkins in Cloud
AIM:
ALGORITHM:
lOMoAR cPSD| 28043727
OUTPUT:
Access Jenkins through the web browser, and you should see the Jenkins dashboard.
Now we can start creating jobs, pipelines, and integrate Jenkins with your version control
system.
RESULT:
Ex. No: 4
Date : Create Cl pipeline using Jenkins
AIM:
The aim of this lab is to create a Continuous Integration pipeline in Jenkins, which
automates the build and test process whenever changes are pushed to the version
control system.
ALGORITHM:
lOMoAR cPSD| 28043727
OUTPUT:
Viewing the console output of the pipeline to monitor the build and test process. The
console output will show the progress of each stage and any errors or failures encountered during
the pipeline execution.
RESULT:
Upon successful execution, Jenkins pipeline will have automated the build
and test process of project. Future changes pushed to the version control system
will trigger Jenkins to automatically build and test your project, providing
continuous integration and early detection of issues.
lOMoAR cPSD| 28043727
Ex. No: 5
Date : Create a CD pipeline in Jenkins and deploy in Cloud
AIM:
The aim of this lab is to enhance the existing Jenkins pipeline to include
deployment steps, allowing for continuous delivery of your application to a cloud
environment.
ALGORITHM:
lOMoAR cPSD| 28043727
OUTPUT:
RESULT:
Ex. No: 6
Date : Create an Ansible playbook for a simple web
application infrastructure
AIM:
The aim of this lab is to use Ansible to automate the setup of a simple web application
infrastructure.
ALGORITHM:
Yaml
---
- name: Setup Web Application Infrastructure
hosts: web_servers
become: true
tasks:
- name: Install Nginx
apt:
name: nginx
state: present
handlers:
- name: Reload Nginx
service:
name: nginx
state: reloaded
user www-data;
worker_processes auto;
pid /run/nginx.pid;
events {
worker_connections 768;
}
http {
sendfile on;
tcp_nopush on;
tcp_nodelay on;
keepalive_timeout 65;
types_hash_max_size 2048;
include /etc/nginx/mime.types;
default_type application/octet-stream;
lOMoAR cPSD| 28043727
server {
listen 80;
server_name {{ ansible_fqdn }};
root /var/www/html;
location / {
index index.html;
}
[web_servers]
web_server ansible_host=your_web_server_ip
ansible_user=your_ssh_user
[database_servers]
db_server ansible_host=your_db_server_ip
ansible_user=your_ssh_user
OUTPUT:
The console output as Ansible runs the playbook. It will display the progress of
eachtask and report any errors encountered.
RESULT:
Upon successful execution of the Ansible playbook, web servers will have
Nginx installed and configured, and database server will have MySQL installed and
secured. The web application infrastructure is now set up according to the defined
specifications.
lOMoAR cPSD| 28043727
AIM:
The aim of this lab is to create a simple Java application and use Gradle to build
and manage dependencies.
ALGORITHM:
lOMoAR cPSD| 28043727
lOMoAR cPSD| 28043727
OUTPUT:
The output in the terminal as Gradle downloads dependencies, compiles the code,
andbuilds the JAR file.
RESULT:
Ex. No: 8 Install Ansible and configure ansible roles and to write playbooks
Date :
AIM:
The aim of this lab is to install Ansible, configure Ansible roles, and write
playbooksfor managing configurations on target machines.
ALGORITHM:
lOMoAR cPSD| 28043727
lOMoAR cPSD| 28043727
lOMoAR cPSD| 28043727
OUTPUT:
The output in the terminal as Ansible executes tasks defined in the playbooks and roles.
RESULT: