CI_CD Project with Github-Jenkins-Sonarqube-Docker
CI_CD Project with Github-Jenkins-Sonarqube-Docker
Jenkins CI/CD pipeline with GitHub webhook integration for Deploying CSS project on
EC2 instances using Docker and Sonarqube.
6
✔ Code commit will happen in github.
1. First download the free css project from the internet . link:
2. Create a repository in your github and clone that repo in your local machine.
3. Copy the project file in the cloned repo and push the code in you github.
5. You can try any other method also to put the project code in your github.
1. Create 3 separate AWS EC2 instances, one for Docker , one for Sonarqube, one for jenkins. (
Go for t2.medium size , as it is having more memory which will handle the application easily ).
2. Name them with docker, jenkins, sonarqube while creating so that you dont get confused.
3. ssh into docker instance and install docker in it. open port 8085 in security group.
4. ssh into jenkins instance and install java 17 first and then install jenkins in it. Open port 8080
in security group other wise you will get error.
5. ssh into sonarqube instance and install java 17 first and then install sonarqube in it. Open
port 9000 in security group other wise you will get error while opening sonarqube. sonarqube
download link :
66. check and make sure they are active or running properly.
Like Comment
In Jenkins :
1. Login to jenkins through your browser with your instance ip and port 8080 and create a
freestyle project.
4. Go to your github repo and in setting select webhook and in paylaod url give your jenkins url:
(your ip):8080/github-webhook/
Sonarqube : (we need to unzip the downloaded sonarqube zip file and start it)
1. Go to sonarqube instance and install unzip application or package to unzip any file. sudo apt
install unzip
2. Now type unzip (name of the sonarqube zip file that you have downloaded earlier) ex: unzip
Now to start the sonarqube type the following command : ( For LINUX )
ls
cd sonarqube-10.1.0.73491/
ls
cd bin
ls
cd linux-x86-64/
6
ls
Like Comment
./
./ console
1. click Manually
2. Give any project name and key (same name for both) and main branch name=main
3. click setup
5. github
6. configure analysis
7. continue - continue
8. other
10. finish
1. my account
6
2. security
Like Comment
3. In generte token Name = any ; Type= global analysis token ; expire in 30 days.
In Jenkins :
Go to manage jenkins
Now go to global tool configuration - Sonarqube scanner - give any name -install
automatically and save it.
Now go to configuration system - sonarqube server- copy the sonarqube app link(
ip:9000) and paste it . In server authentication token-add-jenkins- kind=secret ;
scope=global ; secret= paste the token that was copied from sonarqube ; Add it and
select the same token in server auth token. save it
2. In analysis: paste the sonar that you have copied ex: sonar.project key= {name}
Now we need to setup docker and jenkins server so that jenkins server can access the
docker server easily:
In Docker Instance :
sudo su
nano /etc/ssh/sshd_config
6
Now in editor enable Public key Authentication yes ; Password Authentication yes ( keep it
same as I haveLike
written ). Comment
save it by typing ctrl+x
ssh-keygen ( enter-enter)
Go to jenkins
1. Manage jenkins
2. system setting
6. save it
In Github :
Like Comment
In Docker Instance:
1. mkdir website
2. cd website
4. newgrp docker
In Jenkins :
Go to project config
1. In build step
Save it and make some changes in your github repo nd the build will start
automatically . After successfull build access it through browser :
✌✌✌✌✌✌✌✌✌✌✌✌✌✌✌✌✌✌✌✌✌✌✌✌✌✌✌✌✌
If you found this article helpful, follow me and share the article with your friends.
#devops #project #share #linux #devopsjobs #content #docker #jenkins #awscloud
6
More articles by this author
Like Comment
Important Terminology and Minikube Installation Set up a Kubernetes c
Concepts of Terraform Process using Kubeadm
Dec 29, 2023 Sep 19, 2023 Sep 15, 2023
See all
Server Architecture
What are the key skills and tools for serverless developers and engineers?
Information Technology
What are some cost-effective strategies for managing your technical architecture?
Cloud Computing
What are the best CI metrics to identify and resolve issues with your APIs?
Continuous Integration
Cloud Development
How do you test and validate your cloud SDK code before deployment?
Software Testing
Like Comment
Show more
Building a Full-Stack Web Application with Angular 15 and Spring Boot 3 from
SCRATCH (2023)
Attia Imed · 6mo
Data Pipeline using Docker, Jenkins (CI/CD) and GitHub deployed on AWS
Atharva Kurle · 5mo
Show more
Explore topics
Sales
Marketing
Business Administration
HR Management
Content Management
6
Engineering
© 2024 About
Language
Like Comment