DevOps Practical
Introduction to DevOps
DevOps is a set of practices that companies/startups follow for writing software.
- The practice is to build, test and deploy each change in the software as soon as the changes are submitted.
- It increases speed of software development and make sure that the software quality is high.
DevOps stages
Devops has these stages
- Plan
- Code
- Build
- Test
- Release
- Deploy
Steps to run DevOps using gitlab
Gitlab provides ready-to-use templates to run DevOps on sample programs.
For Example:
We will use a simple CPP program which adds
and substracts
2 numbers.
-
Get the workspace for devops trial
-
Download the ready to use workspace for devops trial - https://gitlab.iotiot.in/newbies/pre-office-office/refactoring-workspace/-/archive/master/refactoring-workspace-master.zip
-
Unzip the
refactoring-workspace-master.zip
-
Open VScode.
-
Press
Ctrl
+Shift
+p
in VScode. A bar will open up at the top. -
Click on "Remote-Containers: Open Folder in Containers".
-
In the pop up Window, Navigate to Downloads --> refactoring-workspace-master
-
Click on Open.
-
Vscode will take some time to start up the container, once done
-
That is it done you have successfully opened up the workspace.
-
-
Fork the repository.
- Go to link - https://gitlab.iotiot.in/newbies/pre-office-office/devops-trial
- Click on Fork.
- Select your username in the next window.
- The repo will fork and you should be directed to your own copy of the original.
-
Clone the repository.
-
Make changes to the code.
-
Submit the changes.
-
See your code Build, Test and Deploy.
- Go to your repository, CI/CD --> Pipelines.
- You can see Build, Test and Deploy devOps stages passing.
-
Thats is it done, you have successfully seen your code Build, Test and Deployed.