0% found this document useful (0 votes)
25 views

Devops Lab Manuual

Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
25 views

Devops Lab Manuual

Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 24

lOMoARcPSD|12902971

TABLE OF CONTENT

EX NO DATE NAME OF THE EXPERIMENT SIGNATURE


Create Maven Build Pipeline in Azure.
1
Run regression tests using Maven Build pipeline in
2 Azure.
Install Jenkins in Cloud
3
Create CI pipeline using Jenkins
4
Create a CD pipeline in Jenkins and deploy in Cloud
5
Create an Ansible Playbook for a simple web
6 application infrastructure.

Build a simple application using Gradle.


7
Install Ansible and configure ansible roles and to
8 write playbooks.

Downloaded by D.R.Anitha Sofia Liz CSE STAFF ([email protected])


lOMoARcPSD|12902971

Ex. No: 1
Create Maven Build Pipeline in Azure
Date :

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:

Downloaded by D.R.Anitha Sofia Liz CSE STAFF ([email protected])


lOMoARcPSD|12902971

PROGRAM:

Yaml

Example Azure DevOps YAML configuration for Maven Build Pipeline


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'
options: '-Xmx3072m'

Downloaded by D.R.Anitha Sofia Liz CSE STAFF ([email protected])


lOMoARcPSD|12902971

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.

Downloaded by D.R.Anitha Sofia Liz CSE STAFF ([email protected])


lOMoARcPSD|12902971

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:

Downloaded by D.R.Anitha Sofia Liz CSE STAFF ([email protected])


lOMoARcPSD|12902971

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

Downloaded by D.R.Anitha Sofia Liz CSE STAFF ([email protected])


lOMoARcPSD|12902971

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:

Upon successful execution of the pipeline, it will be able to review the


test results in Azure DevOps. If any regression tests fail, the pipeline will
indicate the issues, allowing for quick identification and resolution.

Downloaded by D.R.Anitha Sofia Liz CSE STAFF ([email protected])


lOMoARcPSD|12902971

Ex. No: 3
Install Jenkins in Cloud
Date :

AIM:

The aim is to install Jenkins on a cloud platform, providing a scalable


and centralized solution for continuous integration and continuous
delivery (CI/CD) processes.

ALGORITHM:

Downloaded by D.R.Anitha Sofia Liz CSE STAFF ([email protected])


lOMoARcPSD|12902971

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:

Jenkins is successfully installed on the virtual machine in the cloud. You


can use Jenkins to automate build, test, and deployment processes, improving
the efficiency of your development workflow.

Downloaded by D.R.Anitha Sofia Liz CSE STAFF ([email protected])


lOMoARcPSD|12902971

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:

Downloaded by D.R.Anitha Sofia Liz CSE STAFF ([email protected])


lOMoARcPSD|12902971

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.

Downloaded by D.R.Anitha Sofia Liz CSE STAFF ([email protected])


lOMoARcPSD|12902971

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:

Downloaded by D.R.Anitha Sofia Liz CSE STAFF ([email protected])


lOMoARcPSD|12902971

OUTPUT:

Viewing the console output of the extended pipeline to monitor the


deployment process. The console output will show the progress of each stage,
including the deployment steps.

RESULT:

Upon successful execution, your Jenkins pipeline will automate the


deployment of your application to the cloud. Changes pushed to the version
control system will trigger Jenkins to build, test, and deploy application,
providing continuous delivery to cloud environment.

Downloaded by D.R.Anitha Sofia Liz CSE STAFF ([email protected])


lOMoARcPSD|12902971

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

- name: Configure Nginx


template:
src: nginx.conf.j2
dest: /etc/nginx/nginx.conf
notify: Reload Nginx

- name: Install MySQL


apt:
name: mysql-server
state: present

Downloaded by D.R.Anitha Sofia Liz CSE STAFF ([email protected])


lOMoARcPSD|12902971

. - name: Secure MySQL Installation


mysql_secure_installation:
login_user: root
login_password: "{{ mysql_root_password }}"
new_password: "{{ mysql_root_password }}"
validate_password: no

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;

Downloaded by D.R.Anitha Sofia Liz CSE STAFF ([email protected])


lOMoARcPSD|12902971

server {
listen 80;
server_name {{ ansible_fqdn }};
root /var/www/html;

location / {
index index.html;
}

error_page 500 502 503 504 /50x.html;


location = /50x.html {
root /usr/share/nginx/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

ansible-playbook -i inventory.ini web_app_infrastructure.yml --extra-


vars "mysql_root_password=your_mysql_root_password"

Downloaded by D.R.Anitha Sofia Liz CSE STAFF ([email protected])


lOMoARcPSD|12902971

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.

Downloaded by D.R.Anitha Sofia Liz CSE STAFF ([email protected])


lOMoARcPSD|12902971

Ex. No: 7 Build a simple application using Gradle


Date :

AIM:

The aim of this lab is to create a simple Java application and use Gradle to build
and manage dependencies.

ALGORITHM:

Downloaded by D.R.Anitha Sofia Liz CSE STAFF ([email protected])


lOMoARcPSD|12902971

Downloaded by D.R.Anitha Sofia Liz CSE STAFF ([email protected])


lOMoARcPSD|12902971

OUTPUT:

The output in the terminal as Gradle downloads dependencies, compiles the code, and
builds the JAR file.

RESULT:

Upon successful execution, a simple Java application built with Gradle.


This project can be extended by adding more classes, dependencies, and
configurations to meet the requirements of application.

Downloaded by D.R.Anitha Sofia Liz CSE STAFF ([email protected])


lOMoARcPSD|12902971

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:

Downloaded by D.R.Anitha Sofia Liz CSE STAFF ([email protected])


lOMoARcPSD|12902971

Downloaded by D.R.Anitha Sofia Liz CSE STAFF ([email protected])


lOMoARcPSD|12902971

Downloaded by D.R.Anitha Sofia Liz CSE STAFF ([email protected])


lOMoARcPSD|12902971

OUTPUT:

The output in the terminal as Ansible executes tasks defined in the playbooks and roles.

RESULT:

Upon successful execution of the playbooks, target machines will be configured


based on the roles and tasks defined. Ansible will manage configurations,
ensuring consistency across infrastructure.

Downloaded by D.R.Anitha Sofia Liz CSE STAFF ([email protected])

You might also like