Devops Lab Manuual
Devops Lab Manuual
TABLE OF CONTENT
Ex. No: 1
Create Maven Build Pipeline in Azure
Date :
AIM:
ALGORITHMS:
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'
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.
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:
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
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
Install Jenkins in Cloud
Date :
AIM:
ALGORITHM:
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
Create Cl pipeline using Jenkins
Date :
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:
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.
Ex. No: 5
Create a CD pipeline in Jenkins and deploy in Cloud
Date :
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:
OUTPUT:
RESULT:
Ex. No: 6
Create an Ansible playbook for a simple web
Date :
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;
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 each
task 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.
AIM:
The aim of this lab is to create a simple Java application and use Gradle to build
and manage dependencies.
ALGORITHM:
OUTPUT:
The output in the terminal as Gradle downloads dependencies, compiles the code, and
builds 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 playbooks
for managing configurations on target machines.
ALGORITHM:
OUTPUT:
The output in the terminal as Ansible executes tasks defined in the playbooks and roles.
RESULT: