DevOps Lab Experiments
1. Write code for simple user registration form for an event
Let us create a couple of html files for the User registration form for an
event. In our case we are registering a user for a job event. Below are
the html files for our experiment.
user_registration.html
<!-- User registration form -->
<html>
<head>
<title>User Registration</title>
</head>
<body>
<h1>Enter your details for registration</h1>
<form method="post" action="./response.html">
<label for="username">Username:</label>
<input type="text" id="username" name="username" required><br><br>
<label for="password">Password:</label>
<input type="password" id="password" name="password" required><br><br>
<label>Skills:</label><br>
<input type="checkbox" name="skills" value="C"> C<br>
<input type="checkbox" name="skills" value="C++"> C++<br>
<input type="checkbox" name="skills" value="Java"> Java<br>
<input type="checkbox" name="skills" value="Python"> Python<br><br>
<label>Gender:</label><br>
<input type="radio" name="gender" value="Male"> Male<br>
<input type="radio" name="gender" value="Female"> Female<br><br>
<label for="location">Location:</label>
<select id="location" name="location">
<option value="Hyderabad">Hyderabad</option>
<option value="Mumbai">Mumbai</option>
<option value="Delhi">Delhi</option>
</select><br><br>
<input type="submit" value="Submit">
</form>
</body>
</html>
response.html
<!DOCTYPE html>
<body>
Thank you for submitting the details
</body>
</html>
2. Explore git and GitHub commands
Create a new folder with the desired repository name and then run the below
command on CMD prompt
git init
It initiates a repository
We need to create folders and files in the repository
mkdir <folder name>
cd <folder name>
Add files to the folders
git status
It helps us to know the status of the files that we are working for the
repository.
git add <file name/folder name/.(to add all the files/folders in the current
folder)>
It adds the mentioned files to the staging area
NOTE: If we run the git status command you can see change in status
git commit –m ‘commit message’
We need to commit the contents added to the staging to the local repository.
Run git status command again to see the change in status
So far, you have created a repository in your local system, committed files to it.
Below steps help you to create a remote repository and move your files to the
remote repository.
1. Go to www.github.com
2. Login or create an account if you do not have.
3. Create a new repository, with a name, description and other options.
4. Copy the repository URL and run the below commands in your CMD
prompt
git remote add <remote_name> <repository_url>
Example: git remote add origin https://github.com/user/repo.git
git remote –v
It shows the remote repository URL that we added.
git push
It pushes your local repository files to the remote repository.