External Devops
External Devops
Aim: Write code for a simple user registration form for an event.
Objective:
To create a basic user registration form for an event using HTML and CSS.
Procedure:
3. Write the HTML code for the registration form including fields like name, email, phone
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
</head>
<body>
<form>
<label for="name">Name:</label>
<label for="email">Email:</label>
<label for="phone">Phone:</label>
</form>
</body>
</html>
body {
margin: 20px;
}
form {
padding: 20px;
width: 300px;
input[type="text"],
input[type="email"],
input[type="tel"],
input[type="submit"] {
width: 100%;
padding: 10px;
margin: 5px 0;
box-sizing: border-box;
input[type="submit"] {
background-color: #4CAF50;
color: white;
border: none;
input[type="submit"]:hover {
background-color: #45a049;
5. Save the files and open registration_form.html in a web browser to test the form functionality.
Objective:
To understand the basic Git commands and how to use GitHub for version control.
the GIT full form is “Global Information Tracker,” a powerful version control system widely used for software
development and other collaborative projects. GIT allows multiple developers to work on a project simultaneously
while ensuring that their changes do not interfere with one another.
Procedure:
For Windows: Download and install from Git website – 64 bit window exe setup.
3. These are some basic command of git/Linux before going into the git we need to know.
Write output-
Write output-
Write output-
Write output-
Write output-
6) Verify if the directory is created, list the files and folders in the current directory – ls
Write output-
Write output-
Write output-
9)To edit file we will need editor – vi filename (which is similar to note pad)
Write output-
10)To get into the insert mode - type i ( you will see --Insert-- )
Write output-
Write output-
12)To save the file - type :wq( where w is write and q is quit)
Write output-
Write output-
Write output-
Write output-
Write output-
17) To verify if local repository created or not - ls -a (you should see a directory called .git/)
Write output-
18) To check the status of git - git status( if the file are in red color then they are in working directory which change
can be made)
Write output-
19) To send file from working directory to stageing - git add <file name>
Write output-
Write output-
21) To commit the files (for which is to stageing to local repository) - git commit -m "this is the updated file"
Write output-
22) again check the status - git status(On branch master nothing to commit, working tree clean)
Write output-
Write output-
Write output-
25) To commit the files (for which is to stageing to local repository) - git commit -m "this is the updated file"
Write output-
Write output-
will create a new branch (feature branch) or sub branch and will do changes in it and will request to merge.
git branch - * symbol - to verify if the current branch is switched to new branch
24) $ git branch == it shows what are the local branches in our local repository
$ git branch
* master
25) creates a new branch from the new branch. = git branch <newbranchname>
[note - the above command creates a new branch only, it does not switch to new branch and stays in old branch
only.]
29) $ ls
31)git status
32)git add .
34) $ git merge <submaster >– for merger you need to checkout to master first and merger the file of newbranch to
master branch.
Experiment 3:
Practice Source code management on GitHub. Experiment with the source code in exercise-1.
Aim: To practice source code management using Git and GitHub for the registration form created in Experiment 1.
Procedure:
To practice source code management on GitHub, you can follow these steps:
• Navigate to Repositories: Click on your profile picture in the top-right corner, then select "Your repositories."
• Create a New Repository: Click the "New" button or "Create a new repository."
• Initialize this repository with a README: Optionally, check this box if you want to include a README file.
Link your local repository to a GitHub repository using git remote add origin command.
----------------------------------------------------------------------------------------------------------------
clone :-
When you create a repository on GitHub, it exists as a remote repository. You can clone your repository to create a
local copy on your computer and sync between the two locations.
Write output-
Push :- The git push command is used to upload local repository content to a remote repository.
Write output-
==================================================================================
Pull:-
The git pull command is used to fetch and download content from a remote repository and immediately update the
local repository to match that content.
Write output-
Jenkins is an automation server that helps to automate the build, test, and deployment of software
Jenkins is a popular open-source tool for Continuous Integration and Continuous Deployment (CI/CD) in software
development. Here are the steps to install and set up Jenkins:
--------------------------------------------------------------------------------------
if version output given java is installed in machine -> Go for Jenkins installation
steps:
1. Download the Jenkins Installer: Visit the official Jenkins website (https://www.jenkins.io) and navigate to the
Downloads page. Download the Windows installer package (usually an .msi file) compatible with your system.
2. Run the Installer: Locate the downloaded .msi file and double-click on it to run the Jenkins installer. You may be
prompted to grant administrative permissions.
3. Select Installation Directory: In the installer window, select the installation directory for Jenkins. The default
location is typically in the "Program Files" directory. You can choose a different directory if desired.
4. Choose Installation Options: On the next screen, you can select additional installation options, such as creating
shortcuts or configuring Jenkins to run as a Windows service. Make the desired selections and proceed.
5. Customize Jenkins URL: In the subsequent screen, you can choose the Jenkins URL, which is the address you'll use
to access the Jenkins web interface. By default, it will be http://localhost:8080. You can keep the default or specify a
different URL if needed.
6. Complete the Installation: After configuring the installation options, click on the "Install" button to start the
installation process. Wait for the installer to complete the installation of Jenkins on your Windows 11 system.
7. Launch Jenkins: Once the installation is finished, you can choose to launch Jenkins automatically by keeping the
corresponding checkbox selected. Otherwise, you can manually launch Jenkins later from the Start menu or desktop
shortcut
8. Access Jenkins Web Interface: Open a web browser and enter the Jenkins URL (e.g., http://localhost:8080) in the
address bar. The Jenkins web interface should load, and you'll be prompted to unlock Jenkins page by entering the
initial administrative password.
9. Retrieve Initial Admin Password: To retrieve the initial administrative password, navigate to the Jenkins installation
directory on your computer.
(i.e: c/programData/Jenkins/.jenkins/secrets/initialAdminPassword.
Look for a file called "initialAdminPassword" and open it using a text editor(like Notepad). Copy the password and
paste it into the Jenkins web interface to proceed.
10. Follow Setup Wizard: The Jenkins setup wizard will guide you through the remaining configuration steps,
including installing recommended plugins and creating the first administrative user. Follow the instructions on the
screen to complete the setup. By following these steps, you can install Jenkins on Windows
11 and start using it for your continuous integration and continuous delivery (CI/CD) workflows. Note: Make sure
your system meets the minimum requirements for running Jenkins, such as having Java Development Kit (JDK)
installed.
DESCRIPTION
Before diving into Docker commands, it's important to understand how Docker fits into content management.
• Docker is a platform that enables you to package applications into containers. These containers are isolated,
lightweight environments that ensure consistency across different environments.
• In the context of content management, Docker can be used to containerize CMS applications (like WordPress,
Joomla, etc.), media processing tools, file servers, or static website generators.
• Docker helps ensure that these systems are portable, easy to deploy, and scalable, enabling efficient content
management workflows.
• Container: A lightweight, standalone, and executable package that includes everything needed to run a piece
of software (code, runtime, system tools, libraries).
• Image: A read-only template used to create containers. You can think of it as a snapshot of a filesystem and
applications.
• Docker Hub: A cloud-based repository where Docker images are stored and shared.
2. Install Docker
If Docker desktop is not installed on your system yet, follow these steps:
• Windows/Mac: Download and install Docker Desktop from Docker's official site.
------
Open CMD
$ wsl --version
Case-1:
Note:
$ wsl --status
Sample Output:
Default Version: 2
$ wsl --set-default-version 2
Case-2:
-> Click OK
----------------------
Wsl --status
Wsl --update
-------
-> Double-click Docker Desktop Installer.exe to run the installer. By default, Docker Desktop is installed at C:\Program
Files\Docker\Docker.
-> When prompted, ensure the Use WSL 2 instead of Hyper-V option on the Configuration page is selected or not
depending on your choice of backend.
-> Follow the instructions on the installation wizard to authorize the installer and proceed with the install.
-> When the installation is successful, select Close to complete the installation process.
------
Docker is a containerization technology that is widely used for managing application containers. Here are some
commonly used Docker commands for content management:
Docker commands
steps: -
The container on which application is running cannot be directly connected to. To overcome this challenge docker
has introduced concept of port forwarding, where one of the port from the host-system (the machine on which the
docker is installed ) can be mapped to the port of container where the application in running in the container.
6. docker rm <container id/container name>: to delete the container which is in stopped state or nor running state.
7.docker stop <container id/container name> : to stop the running container and then you can remove the docker
container.
9.docker start <container id/container name> : to start the container which are in stopped state.
10.docker images: This command lists all images stored locally on the host.
12. docker login -u <docker hub username>: To login to docker account using CLI
Enter password:
13. docker push <registry-url>/<repo-name>:<tag>:1 - To push image into our docker repository
14. docker rmi <imageid/image-name>: To delete an image which is not in use with any container
These are some of the basic Docker commands for managing containers and images. There are many other Docker
commands and options that you can use for more advanced use cases, such as managing networks, volumes, and
configuration. However, these commands should give you a good starting point for using Docker for content
management.
DESCRIPTION:
Here's an example of how you can develop a simple containerized application using Docker:
Prerequisite: The docker file and the index.html must be in the same location. Desktop preferably.
Steps:
FROM nginx:latest [ a key word to set base image for the container]
COPY index.html /usr/share/nginx/html/index.html [ a keyword to copy file from local machine to container] Note:
The words in capital letters are referred to as key words.
1. Save the file with the name as “Dockerfile” and save the file without any extension on Desktop.
3. Execute the following command in terminal to build a image out of the Dockerfile.
Note-2: as we are not mentioning any filename in the command, docker will search for a file named:Dokerfile and
build an image according to the instructions provided in that file.
1. Docker images
2. Now that the image is created, We can run the image to build a container out of it using the following
command: docker run -d -p 8081:80 --name <container-name> <image-name-built-in-last-step>
3. Now goto localhost:8081 - you need to get the updated index page.
This is a simple example of how you can use Docker to containerize an application. In a real-world scenario, you
would likely have more complex requirements, such as running multiple containers, managing network connections,
and persisting data. However, this example should give you a good starting point for using Docker to containerize
your applications