Skip to content

Kamalesh-Seervi/vprofile_CI_jenkins

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Prerequisites

  • JDK 1.8 or later
  • Maven 3 or later
  • MySQL 5.6 or later

Technologies

  • Spring MVC
  • Spring Security
  • Spring Data JPA
  • Maven
  • JSP
  • Sonarqube (ubuntu 18.04 | port 9000)
  • Nexus (centos7 | port 8081)

Plugins

  • Sonarqube scanner
  • maven
  • Maven pipeline configuration
  • Slack Notification
  • Nexus

Architecture:

image

Code Analysis:

  • Go to global configuration and set the sonarqube scanner.
  • Save settings.
image
  • Now go to configure settings and configure the sonarqube server.
  • Generate token from Sonarqube site and paste it in configure.
image

Code Analysis -> Checkstyle method:

  • Use Chechstyle branch and my repo link.
  • Create a new item and select pipeline.
  • paste the above Jenkinsfile and change the tools name accordingly
  • Build the job now.
image

Code Analysis -> sonarqube

  • Use sonar_analysis branch and my repo link.
  • Create a new item and select pipeline.
  • Paste the above Jenkinsfile and change the tools name accordingly
  • Build the job now.
  • This is server name in jenkins for sonarqube.
withSonarQubeEnv('sonar_server') 
image

Quality gate:

  • Bugs: 60
  • Go to project in sonarqube -> project settings -> quality gate -> select the created quality gate.
  • Now go to sonarqube -> project settings -> webhooks -> create webhook.
http://<jenkins-IP>:8080/sonarqube-webhook
  • Now checkout the quailty-gate branch and use the jenkinfile as pipeline code and paste it in jenkins
  • BUILD NOW
image
  • Build success because the actual bugs is less than < 60
image

Nexus

  • Go to nexus server -> repository -> maven2(hosted)
  • Create a repo in nexus.
  • Go to manage config in jenkins change the ip of jenkins and sonarqube to private ips
  • Save it
  • Now go to manage credentials create a credential for nexus.
  • Build NOW
image
  • Nexus browse page
image

Notifications/Slack

  • Create account in https://slack.com
  • Create Workspace and channel in slack.
  • Go to apps in slack and search for jenkinsCI.
  • Copy the secret key.
  • Now go to jenkins manage configure and add the secret key.
  • Add pipeline code now
image

#DockerCI

  • Create IAM user in aws.
  • Add the aws credentials to jenkins

About

complete CI job using Nexus and sonarqube

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published