DEVOPS LAB MANUAL
SREYAS
Table of Contents
Page
S.No Program Name
No.
DEVOPS
1 Write code for a simple user registration form for an 2-3
event
2 Explore Git and GitHub commands 3-4
3 Practice Source code management on GitHub. 5-6
Experiment with the source code written in exercise 1
4 Jenkins installation and setup, explore the environment
5 Demonstrate continuous integration and development
using Jenkins
6 Explore Docker commands for content management
7 Develop a simple containerized application using
Docker
8 Integrate Kubernetes and Docker
9 Automate the process of running containerized
application for exercise 7 using Kubernetes
10 Install and Explore Selenium for automated testing
11 Write a simple program in JavaScript and perform
testing using Selenium
12 Develop test cases for the above containerized
application using selenium
Department of Computer Science and Engineering(AI&ML) , SREYAS Page 1
DEVOPS LAB MANUAL
SREYAS
Experiment 1: Write code for a simple user registration form for an event.
Program Objectives: The objective of this program is to create a simple user
registration form for an event. The form will collect the user's name, age, date of
birth (DOB), mobile number, and Gmail address. Upon submission, the form will
process the entered data and possibly store it in a database or perform other
operations as needed.
Description: This HTML code creates a basic registration form with fields for the
user to input their name, age, DOB, mobile number, and Gmail address. The form
also includes a submit button for the user to submit their registration details.
Code:
<html>
<head>
<title>registration form</title>
</head>
<body>
<h6>
<label="name">Name:</label>
<input type="text" name="name"><br><br>
<label="age">Age:</label>
<input type="text" name="Age"><br><br>
<label="DOB">DOB:</label>
<input type="text" name="DOB"><br><br>
<label="mobile no">Mobile No:</label>
<input type="text" name="mobile no"><br><br>
<label="gmail">Gmail:</label>
<input type="text" name="Gmail"><br><br>
<input type="submit" value="submit"><br><br>
</h6>
</body>
Department of Computer Science and Engineering(AI&ML) , SREYAS Page 2
DEVOPS LAB MANUAL
SREYAS
</html>
Output: A rendered HTML page will display the registration form as described
above, allowing users to input their details and submit the form
Experiment 2: Explore Git and GitHub commands
Program Objectives: The objective of this experiment is to familiarize yourself
with essential Git and GitHub commands commonly used in day-to-day
development workflows. Through this experiment, you will learn how to initialize
a Git repository, track changes, create branches, collaborate with remote
repositories on GitHub, and manage version history.
Description: In this experiment, you will explore fundamental Git and GitHub
commands and their functionalities. These commands will help you understand
version control concepts and enable you to efficiently manage your project's source
code.
List of Git and GitHub Commands:
1. git init: Creates a new empty Git repository in the current directory.
2. git status: Shows the current status of your files in the Git repository, indicating
which files are staged, modified, or untracked.
3. git add: Stages changes (new files, modifications, deletions) in the current
directory.
Example:
git add . - stages all files in the current directory.
git add file.txt - stages file.txt in the Git directory.
Department of Computer Science and Engineering(AI&ML) , SREYAS Page 3
DEVOPS LAB MANUAL
SREYAS
4. git commit: Saves staged changes to the local repository, creating a new commit
with a snapshot of the changes along with a commit message to describe the
changes.
Example: git commit -m "my first file for website design"
5. git branch -M main: Renames the current branch to "main".
6. git remote add origin : Links your local Git repository with a remote repository
hosted on a service like GitHub.
Example: git remote add origin
https://github.com/NAGENDRASAICH/myproject.git
7. git push -u origin main: Pushes local commits from the main branch of your
local repository to the remote repository named "origin" on a branch also named
"main".
8. git branch: Lists all branches in your local repository and highlights the current
branch.
9. git checkout -b : Creates a new branch.
Example: git checkout -b sreyasnewproject
10. git reset: Undoes a commit.
Example: git reset HEAD file.txt - unstages changes for a specific file named
file.txt.
11. git fetch: Downloads changes from a remote repository into the local
repository.
12. git merge: Merges changes from one branch into another branch.
13. git clone: Clones a remote repository into a new directory on your local
machine.
Example: git clone https://github.com/example/example.git
14. git log: Displays a history of commits in the repository.
15. git pull: Fetches and downloads content from a remote repository and
immediately updates the local repository to match that content.
Program Outcomes: Upon completion of this experiment, you will be able to:
Initialize a Git repository and track changes.
Create branches and manage version history effectively.
Department of Computer Science and Engineering(AI&ML) , SREYAS Page 4
DEVOPS LAB MANUAL
SREYAS
Collaborate with remote repositories on platforms like GitHub. Understand the
importance of version control in software development workflows.
Experiment 3: Practice Source code management on GitHub. Experiment with the
source code written in exercise 1.
Program Objectives: The objective of this experiment is to demonstrate the
process of managing source code using Git and GitHub. You will learn how to
initialize a local Git repository, add and commit changes to it, and then push those
changes to a remote repository on GitHub. Through this hands-on demonstration,
you will understand the workflow involved in source code management and
collaboration using version control systems.
Description: In this experiment, you will practice source code management using
Git and GitHub. You will start by initializing a local Git repository in your project
directory, adding your source code files to the repository, and committing changes
with descriptive commit messages. Then, you will create a remote repository on
GitHub and link it with your local repository. Finally, you will push your local
commits to the remote repository on GitHub, making your source code accessible
to collaborators and enabling seamless collaboration and version control.
Steps:
Step-1: Place your file in any folder for example my file is 1.html . So , i will place
that file in a folder named “projects” in my Desktop location
Step-2: Open terminal in the same location where your file (1.html) is located and
type following commands:
git init
it will initialize new empty Git repository in the current directory where, 1.html is
located
git status
it Shows the current status of your files in the Git repository initially, my file
1.html is not stored it git repository , so it will show 1.html it red colour, which
indicates that our file 1.html is not transferred to git repositroy, now we need to
move our file to git repository
git add .
It will move all files which are present in my folder to git repository
git status
Department of Computer Science and Engineering(AI&ML) , SREYAS Page 5
DEVOPS LAB MANUAL
SREYAS
Now, status will display “1.html” in green colour, which indicates that our file
“1.html” is transferred to git repository.
“This is how we transfer files to git repository” now other task is to transfer files
from git to github repository:
Step-1: open git hub website
Step 2: generate token and save it any location in your system open github website
-> settings -> Developer settings -> personal access tokens -> Token (classic) -
>generate new token -> give any name to your token and accept all checkboxes ->
generate token now save that token no in text editor for future use generally we
need token to trasfer files from git to github website
Step-3: now create repository with any name for example : here, i will give my
repository name as “my repositroy:
Step-4: now we need to create branch and move 1.html which is located in git
repository to git hub website so run these commands:
git commit -m “myfirstcode”
git branch -M master
git remote add origin https://github.com/NAGENDRASAICH/my-repository.git
git push -u origin master
enter user name and password(token no) now you file is successfully transferred to
git hub webiste fo git repository
Program Outcomes:
Upon completion of this experiment, you will be able to:
1. Initialize a local Git repository for your project.
2. Add source code files to the local repository and commit changes with
meaningful commit messages.
3. Create a remote repository on GitHub to host your project.
4. Link your local Git repository with the remote repository on GitHub.
5. Push your local commits to the remote repository on GitHub, enabling
collaboration and version control.
6. Understand the importance of source code management and version control in
software development projects.
Department of Computer Science and Engineering(AI&ML) , SREYAS Page 6