Sonarqube

Now we going to do SonarQube 


Lets go to EC2 Instance and copy the public IP of the Sonarqube instance, go to website and paste it in website. It will bring it in to Sonarqube site now we need to sign in username: admin Password:admin.

Security---Generate Token: Copy the path from the security and paste it in github.


Manage Jenkins--- Manage Plugins---Available--- Sonarqube Scanner and sonar quality gates --- Install without restart.

Manage jenkins-- Global Tool Configuration---Sonarqube scanner: Add sonarqube scanner----Version:sonarqube scanner 4.4.0.2170 ---Name:SONAR-4.4.2170 ------Save.

Manage jenkins---Configuration----Sonarqube Server: Add Name: Sonar-vprofile----server URL: HTTP://<PRIVATE IP> ------ server authentication Token: Add Jenkins---- add sonar token-----Save.

Manage jenkins---Configuration----Quality Gate- Sonarqube : Add Name: Sonar-vprofile----server URL: HTTP://<PRIVATE IP> ---------Save.

Sonar Scanner_Code Analysis

 we gonna create Sonar Scanner_Code Analysis file-----  New file----Freestyle Rules---name of the project: Sonar Scanner_Code Analysis ------Copy From: Build  ----OK

Copy from build: This will copy all the thing what we did in the Build.

Change the below part in the Sonar Scanner_code Analysis file 

Invoke top-level Maven target: goals: Install ------Property --- SNAP-REPO=vprofile-snapshot

NEXUS-USER=admin

NEXUS-PASS=Jeeva27aditya

RELEASE-REPO=vprofile-release

CENTRAL-REPO=vprofile-maven-central

NEXUS-GRP-REPO=vprofile-maven-group

NEXUSIP=172.31.92.213

NEXUSPORT=8081

copy this and save it in the property---setting file: File path: setting.xml -----Save------------Build now.

Now we don't want to add Artifact

Configure-----Post-build-action---give artifact or files to archive: **/*.war--------------Click save  cancel from the Test file we need it only for Build.---- Save the file. ------Click Build Now

We will get the notification in stack for each and every step.


Nexus Repository Integration

Manage Jenkins--- Manage Plugins---Available--- Nexus Artifact Uploader and Copy Artifact --- Install without restart.

Manage Jenkins--- Manage Plugins---Available--- Zentimestamp --- Install without restart.

we gonna create Deploy-to Nexus file-----  New file----Freestyle Rules---name of the project: Deploy-to Nexus----OK

Change the below part in the Nexus file 

Build------Add Build step is ----Copy artifacts from another project----project name: Build---Artifacts to copy:**/*.war

Add build step-----Nexus artifacts upload------ Name version: NEXUS3 -------Nexus URL: <Private ip>:8081-----Credentials: Jenkins and choose nexus server-------GroupID: QA----- Version: $BUILD_ID---------Repository:vprofile-release-----Artifacts: add artifacts: Artifacts Id: $BUILD_TIMESTAMP-----Type:war-----File:target/vprofile-v2.war -----------save


Configure Slack Notification

manage jenkins---- manage plugins------post build action----------- select what are the requirements we need-------save

Build Now


Sonar Scanner-CodeAnalysis

Mange Jenkins---Configure---Post build action--- Build other project-------Project to build: Deploy-to nexus----Trigger only when its stable---save.

Manage jenkins---- Manage plugins------Available------Build pipeline----install without start

vprofile continuous integration---Bild pipeline view----ok---- Pipeline Flow: upstream/downstream: Build--------Display Options: 5---- Save.


Now we can see our Pipeline is running fine we can see beautiful layout.



OUR PROJECT IS SUCCESSFULLY DONE! AND ITS UP AND RUNNING