This project demonstrates a complete DevOps workflow using a Java Spring Boot application with CI/CD pipeline powered by Jenkins, SonarQube, Docker, Kubernetes, and ArgoCD.
| Tool | Purpose |
|---|---|
| Spring Boot | Web application framework |
| Jenkins | CI/CD automation |
| SonarQube | Code quality and static analysis |
| Docker | Containerization |
| Kubernetes | Application deployment and scaling |
| ArgoCD | GitOps-based continuous delivery |
| GitHub | Code and deployment manifest hosting |
| Docker Hub | Container image registry |
sudo apt update
sudo apt install openjdk-17-jdk -y
wget -q -O - https://pkg.jenkins.io/debian-stable/jenkins.io.key | sudo apt-key add -
sudo sh -c 'echo deb https://pkg.jenkins.io/debian-stable binary/ > /etc/apt/sources.list.d/jenkins.list'
sudo apt update
sudo apt install jenkins -y
sudo systemctl enable jenkins
sudo systemctl start jenkinsAccess Jenkins at http://<ip>:8080. To get the password:
sudo cat /var/lib/jenkins/secrets/initialAdminPasswordInstall suggested plugins and also install:
-
Docker Pipeline
-
SonarQube Scanner
-
GitHub Plugin
sudo apt install docker.io -y
sudo systemctl enable docker
sudo systemctl start docker
sudo usermod -aG docker jenkins
sudo systemctl restart jenkinssudo apt update
sudo apt install openjdk-17-jdk unzip wget -y
sudo adduser sonarqube
cd /opt
sudo wget https://binaries.sonarsource.com/Distribution/sonarqube/sonarqube-9.9.4.87374.zip
sudo unzip sonarqube-9.9.4.87374.zip
sudo mv sonarqube-9.9.4.87374 sonarqube
sudo chown -R sonarqube:sonarqube /opt/sonarqube
sudo chmod -R 775 /opt/sonarqube
sudo su -s /bin/bash sonarqube
cd /opt/sonarqube/bin/linux-x86-64/
./sonar.sh start
./sonar.sh statusAccess SonarQube at http://<ip>:9000 and log in using admin/admin. Create a project and generate a token.
Go to Manage Jenkins > Credentials > Global > Add Credentials:
-
GitHub: Username + Token (with repo access)
-
Docker Hub: Username + Docker token
-
SonarQube: Secret text (Sonar token)
curl -LO "https://dl.k8s.io/release/$(curl -s https://dl.k8s.io/release/stable.txt)/bin/linux/amd64/kubectl"
chmod +x kubectl
sudo mv kubectl /usr/local/bin/Start your Kubernetes cluster using your preferred method.
kubectl create namespace argocd
kubectl apply -n argocd -f https://raw.githubusercontent.com/argoproj/argo-cd/stable/manifests/install.yaml
kubectl patch svc argocd-server -n argocd -p '{"spec": {"type": "NodePort"}}'
kubectl get svc argocd-server -n argocdGet ArgoCD password and access it from the browser:
kubectl get secret -n argocd
kubectl edit secret argocd-initial-admin-secret -n argocd
echo <password> | base64 --decodeUse the UI to configure an application:
-
Git Repo: Link to your repo
-
Path:
springboot-app-manifests -
Namespace: default
-
Sync: Auto or Manual
Ensure the service in service.yml is of type NodePort to allow browser access.
-
Pull code from GitHub
-
Run SonarQube analysis
-
Build app using Maven
-
Build Docker image and push to Docker Hub
-
Update
deployment.ymlwith new image -
Push updated YAMLs to GitHub
-
ArgoCD detects changes and deploys the app
