Bus Ticketing System - DevOps
Bus Ticketing System - DevOps
MT2022161-Aditya.M
MT2022163-Kiran Kumar B
Links:
• Source Code:
▪ BusTicketingSystem-DevOps/Client (github.com)
▪ BusTicketingSystem-DevOps/Server (github.com)
• Docker Images:
▪ adityagowda2000/client general | Docker Hub
▪ adityagowda2000/server general | Docker Hub
DevOps Tools Used:
Login Page
Register Page
User Screens
Admin Screens
Test Cases for backend
Test Cases for frontend
API’s Listing:-
Users Controller:
Buses Controller:
Bookings Controller:
Project Steps:
1. Version Control with GitHub
Client repo is used to maintain the front end source code along with the
dockerfile to containerize the frontend of the application.
Server repo is used to maintain the back end source code along with the
dockerfile to containerize backend of the application . It also contins the
deploy.yaml file which Ansible used to deploy the application to target
machine in the inventory. It also contains the docker-compose.yaml file
which is used to setup the front end and back end container on the target
machine.
We are using git-crypt to encrypt the secretes stored in .env files and all
the target machines ip address in the inventory file of the Server
repository.
How to setup git-crypt: AGWA/git-crypt: Transparent file encryption in git (github.com)
How to decrypt the secretes in Jenkins: Git-Crypt with Jenkins. Before going forward let’s just
see… | by vishant sharma | Medium
Ngrok setup
Used to convert the private IP address of the Jenkins server into
public address so we can use webhooks to automatically rebuildthe
project when new changes are pushed into the GitHub
repository.
• Install ngrok on you system after creating a free account
$ngrok 8080 => to expose port no 8080 to a public IP
Create two new Pipeline project with GitHub hook trigger for GITScm
polling as a build trigger.
[ONE PIPELINE IS LINKED WITH THE CLIENT GITHUB REPO AND ANOTHER IS LINKED WITH SERVER GITHUB REPO.]
Pipeline Scripts:
• Client Pipeline Script
Here we are getting the source code of the frontend from the Client
repo. Then installing all the dependency packages and running the
test cases. If all the test cases are passed then in next stage we will
build the image of the client with help of the dockerFile present and
publish it to DockerHub.
[MORE EXPLAINATION IN FURTHER STEPS ABOUT CREATING IMAGE AND PUSHING TO DOCKER HUB ]
Initial steps are same as Client script where we are pushing the
image containing updated Server code. But here first we are
decrypting the .env and inventory file using the symmetric key
which we had encrypted before pushing the source code to docker
hub.
# Install dependecies
RUN npm install