SlideShare a Scribd company logo
Sonar Jenkins HandsOn
Mak Bhatamrekar
http://github.com/makrand-bkar
AJCP
http://meetup.com/my-ajcp
Atlanta Java Concept Pros
Agenda
• Amazon EC2 & Cloud
• Jenkins
• Sonar
• Tomcat Integration
• Recap
EC2 Launch Steps
EC2 Launch Steps
1. Signup For EC2 http://aws.amazon.com/ec2
2. Signup for Console aws.amazon.com/console
3. Select Launch Instance
4. Select Image
5. Create / Select KeyPair
6. Create / Select Security Group
7. Launch
AWS Console - Select Instance
https://portal.aws.amazon.com/gp/aws/user/subscription/index.html?ie=UTF8&offeri
ngCode=E4F8A8DE (Need to Register on this URL First to Use It)
Download KP and Click Continue
Create Security Group
Sonarjenkins ajip
1) From the menu option “Conversions”, select
“Import key”
2) In the dialog, locate PEM file and “Open” it.
3) Change the comment from ‘imported-openssh-
key” to a something more descriptive
4) Optional: Enter a passphrase.
5) Create PPK file by clicking on “Save private key”
• Open Putty
• Add the “ppk key” in Connections->SSH->Auth
Section
• Session->Enter (Host0Name) / IP Address
• Login in as ec2-user
Sonar Jenkins SVN Instance
https://portal.aws.amazon.com/gp/aws/user/subscription/index.html?ie=UTF8&offeringCode=E4F8A8DE
Port/URL Description credentials
root user -> ec2-user ec2-user is the root user name Use ppk key
:22 Login using SSH Client like Putty. Use PEM Key
:80 Apache Server Test Page
:80/svnmanager
:80/svn/svnrepo
SVN Server admin/p@$$
w0rd
:8080/sonar Sonar on Tomcat Server admin/admi
n
:8181/spring-mvc-showcase/
:8080 Jenkins Server No
credentials
:3306 MySQL Server, use MySQL Client /
SSH Client
root / tiger
:465 Gmail port
Sonarjenkins ajip
What Is Jenkins
• Continuous Integration
- Ant , Maven Builds
- Custom Builds
• Built In Java, Jenkins.war
• Plugin Echo System
• Strong Integration with
Other Tools like
– GIRA --SONAR
– Gerrit --Chat
• Used By – Like Netflix,
LinkedIn,GitHub etc
Some Jenkins Plugins To Have
Plugin Usage
SCM Plugins Source Control Plugins for SVN, P4 etc
JobHistory Plugin History of Changes in Configuration
DiskUsage Plugin Visualize the space , workspace, archived
builds takes.
BuildTimeOut Plugin Kill the Build after TimeOut
Parameterized Trigger Plugin To Pass parameters
Email –Ext Plugin To Format your Emails
• Use Plugins On Need Basis (Total 375 Plugins)
• https://wiki.jenkins-ci.org/display/JENKINS/Plugins
Jenkins Tips
• Do no have Monolithic Builds
– Use Master- Slave to distribute the jobs
– Split Jobs logically
• Jenkins Releases are Weekly
• Join Jenkins Community
Sonarjenkins ajip
• Coding Standards
• Potential Bugs
• Documentation / Comments
• Duplicated Code
• Complexity
• Test Coverage
• Design and Architecture – minimize
dependencies
• Squid (Core Analyzer)
– RFC (Response For Class)
– LCOM4 (Lack Of Cohesion Methods)
– DIT (Depth Of Inherentence Tree)
– NOC – Number Of Children
• CheckStyle (Adheres to Coding Standards)
• PMD (Project Mess Detector)
– Possible Bugs
– Dead Code
– SubOptimial Code
– Complex Expressions
• FindBugs (Static Analysis)
– Malicious Code / Vulnerabilities
• Cobertura & Clover
– Based on Jcoverage java lib
– %tage of Code Accessed by tests
– Calculates Cyclomatic Complexity
• FindBugs (Static Analysis)
– Malicious Code / Vulnerabilities
Introducing Sonar
• Coding Standards
• Potential Bugs
• Documentation
• Duplicated Code
• Complexity
• Test Coverage
• Design & Arch –
– Min Depend, Cohesion, Loose Coupling
• SQUID (Core Analyser)
– LCOM4 – Lack of Cohesion Methods
– DIT – Dependency Of Inheritence Tree
– NOC – No of Children
• CheckStyle
– Coding Standards
– Duplication,
– Memory Outage
• PMD (Project Mess Detector)
– Possible Bugs
– Dead Code
– Complex Expressions
• Find Bugs
– Static Analysis , Trace Bugs
• Cobertura & Clover
– Code Coverage
Sonarjenkins ajip
• OpenSource
• Quality Management Program.
• More Than 600 Code Rules have been
Integrated
• Helps Detect Minor to Critical Defects
• Drills Code Top to Bottom
Watch the Quality Of Code Over Time
• Eclipse Plugin
• PDF Reports
• Maven Ready
• Extensible Plugin System
References
• http://aws.typepad.com
• http://jenkins-ci.org/
• http://www.sonarsource.org/
• https://wiki.jenkins-
ci.org/display/JENKINS/Jenkins+Script+Consol
e
Sonar Jenkins HandsOn
Mak Bhatamrekar
github :http://github.com/makrand-bkar
twitter : mak-bkar
url : www.careerinjava.com
http://meetup.com/my-ajcp
Atlanta Java Concept Pros

More Related Content

PPTX
DevSecCon Tel Aviv 2018 - Integrated Security Testing by Morgan Roman
PPTX
Selenium Automation at Incapsula
PDF
Slides 29-07-2017
PDF
Continuous Everything
PDF
Continuous Everything v2.0
PDF
Cypress e2e automation testing - day1 intor by: Hassan Hameed
PPTX
QA Challenge Accepted 4.0 - Cypress vs. Selenium
PPTX
Azphp phpunit-jenkins
DevSecCon Tel Aviv 2018 - Integrated Security Testing by Morgan Roman
Selenium Automation at Incapsula
Slides 29-07-2017
Continuous Everything
Continuous Everything v2.0
Cypress e2e automation testing - day1 intor by: Hassan Hameed
QA Challenge Accepted 4.0 - Cypress vs. Selenium
Azphp phpunit-jenkins

What's hot (20)

PDF
[123] quality without qa
PDF
Automated Infrastructure Security: Monitoring using FOSS
PPTX
Power shell v3 session1
PDF
Oscp preparation
PDF
[131] packetbeat과 elasticsearch
PDF
EASE spectre meltdown_support
PPTX
VB2013 - Security Research and Development Framework
PDF
So. many. vulnerabilities. Why are containers such a mess and what to do abou...
PDF
Node.js Security Done Right - Tips and Tricks They Won't Teach You In School
PDF
ColdFusion for Penetration Testers
PDF
Prepare to defend thyself with Blue/Green
PPTX
Ansible API
PDF
Mitigating Exploits Using Apple's Endpoint Security
PDF
Anatomy of a Cloud Hack
ODP
2014 ZAP Workshop 2: Contexts and Fuzzing
PDF
Selenoid: browsers in containers
PPTX
Syntribos API Security Test Automation
PPTX
Apache Struts2 CVE-2017-5638
PPTX
Injection flaw teaser
PDF
Android Deobfuscation: Tools and Techniques
[123] quality without qa
Automated Infrastructure Security: Monitoring using FOSS
Power shell v3 session1
Oscp preparation
[131] packetbeat과 elasticsearch
EASE spectre meltdown_support
VB2013 - Security Research and Development Framework
So. many. vulnerabilities. Why are containers such a mess and what to do abou...
Node.js Security Done Right - Tips and Tricks They Won't Teach You In School
ColdFusion for Penetration Testers
Prepare to defend thyself with Blue/Green
Ansible API
Mitigating Exploits Using Apple's Endpoint Security
Anatomy of a Cloud Hack
2014 ZAP Workshop 2: Contexts and Fuzzing
Selenoid: browsers in containers
Syntribos API Security Test Automation
Apache Struts2 CVE-2017-5638
Injection flaw teaser
Android Deobfuscation: Tools and Techniques
Ad

Similar to Sonarjenkins ajip (20)

PDF
Proactive Security AppSec Case Study
PDF
Cloud infrastructure as code
PPTX
Java script nirvana in netbeans [con5679]
PPTX
Understanding container security
PDF
Securing Legacy CFML Code
PPTX
Version Control and Continuous Integration
PDF
Securing applications
PDF
Code quality par Simone Civetta
PPTX
SANS_PentestHackfest_2022-PurpleTeam_Cloud_Identity.pptx
PPTX
Why Kubernetes as a container orchestrator is a right choice for running spar...
PDF
20170831 - Greg Palmier: Terraform & AWS at Tempus
PDF
stackconf 2020 | Replace your Docker based Containers with Cri-o Kata Contain...
PDF
Threat Modeling the CI/CD Pipeline to Improve Software Supply Chain Security ...
PDF
Building machine learning applications locally with Spark — Joel Pinho Lucas ...
PDF
Building machine learning applications locally with spark
PDF
Sitecore development approach evolution – destination helix
PDF
Rapid application development with spring roo j-fall 2010 - baris dere
PPTX
Tech4Africa 2014
PPTX
Ansible benelux meetup - Amsterdam 27-5-2015
PDF
Spinnaker 파트 1
Proactive Security AppSec Case Study
Cloud infrastructure as code
Java script nirvana in netbeans [con5679]
Understanding container security
Securing Legacy CFML Code
Version Control and Continuous Integration
Securing applications
Code quality par Simone Civetta
SANS_PentestHackfest_2022-PurpleTeam_Cloud_Identity.pptx
Why Kubernetes as a container orchestrator is a right choice for running spar...
20170831 - Greg Palmier: Terraform & AWS at Tempus
stackconf 2020 | Replace your Docker based Containers with Cri-o Kata Contain...
Threat Modeling the CI/CD Pipeline to Improve Software Supply Chain Security ...
Building machine learning applications locally with Spark — Joel Pinho Lucas ...
Building machine learning applications locally with spark
Sitecore development approach evolution – destination helix
Rapid application development with spring roo j-fall 2010 - baris dere
Tech4Africa 2014
Ansible benelux meetup - Amsterdam 27-5-2015
Spinnaker 파트 1
Ad

More from Makarand Bhatambarekar (8)

PPT
Bootstrapping angular js with bower grunt yeoman
PPTX
Sprintintegration ajip
PPT
Springaopdecoded ajip
PPT
Story ofcorespring infodeck
PPT
JavaScript JQUERY AJAX
PPTX
Java scriptforjavadev part1
PPTX
Java scriptforjavadev part2a
PPTX
Getting Started with J2EE, A Roadmap
Bootstrapping angular js with bower grunt yeoman
Sprintintegration ajip
Springaopdecoded ajip
Story ofcorespring infodeck
JavaScript JQUERY AJAX
Java scriptforjavadev part1
Java scriptforjavadev part2a
Getting Started with J2EE, A Roadmap

Sonarjenkins ajip

  • 1. Sonar Jenkins HandsOn Mak Bhatamrekar http://github.com/makrand-bkar AJCP http://meetup.com/my-ajcp Atlanta Java Concept Pros
  • 2. Agenda • Amazon EC2 & Cloud • Jenkins • Sonar • Tomcat Integration • Recap
  • 4. EC2 Launch Steps 1. Signup For EC2 http://aws.amazon.com/ec2 2. Signup for Console aws.amazon.com/console 3. Select Launch Instance 4. Select Image 5. Create / Select KeyPair 6. Create / Select Security Group 7. Launch
  • 5. AWS Console - Select Instance https://portal.aws.amazon.com/gp/aws/user/subscription/index.html?ie=UTF8&offeri ngCode=E4F8A8DE (Need to Register on this URL First to Use It)
  • 6. Download KP and Click Continue
  • 9. 1) From the menu option “Conversions”, select “Import key” 2) In the dialog, locate PEM file and “Open” it. 3) Change the comment from ‘imported-openssh- key” to a something more descriptive 4) Optional: Enter a passphrase. 5) Create PPK file by clicking on “Save private key”
  • 10. • Open Putty • Add the “ppk key” in Connections->SSH->Auth Section • Session->Enter (Host0Name) / IP Address • Login in as ec2-user
  • 11. Sonar Jenkins SVN Instance https://portal.aws.amazon.com/gp/aws/user/subscription/index.html?ie=UTF8&offeringCode=E4F8A8DE Port/URL Description credentials root user -> ec2-user ec2-user is the root user name Use ppk key :22 Login using SSH Client like Putty. Use PEM Key :80 Apache Server Test Page :80/svnmanager :80/svn/svnrepo SVN Server admin/p@$$ w0rd :8080/sonar Sonar on Tomcat Server admin/admi n :8181/spring-mvc-showcase/ :8080 Jenkins Server No credentials :3306 MySQL Server, use MySQL Client / SSH Client root / tiger :465 Gmail port
  • 13. What Is Jenkins • Continuous Integration - Ant , Maven Builds - Custom Builds • Built In Java, Jenkins.war • Plugin Echo System • Strong Integration with Other Tools like – GIRA --SONAR – Gerrit --Chat • Used By – Like Netflix, LinkedIn,GitHub etc
  • 14. Some Jenkins Plugins To Have Plugin Usage SCM Plugins Source Control Plugins for SVN, P4 etc JobHistory Plugin History of Changes in Configuration DiskUsage Plugin Visualize the space , workspace, archived builds takes. BuildTimeOut Plugin Kill the Build after TimeOut Parameterized Trigger Plugin To Pass parameters Email –Ext Plugin To Format your Emails • Use Plugins On Need Basis (Total 375 Plugins) • https://wiki.jenkins-ci.org/display/JENKINS/Plugins
  • 15. Jenkins Tips • Do no have Monolithic Builds – Use Master- Slave to distribute the jobs – Split Jobs logically • Jenkins Releases are Weekly • Join Jenkins Community
  • 17. • Coding Standards • Potential Bugs • Documentation / Comments • Duplicated Code • Complexity • Test Coverage • Design and Architecture – minimize dependencies
  • 18. • Squid (Core Analyzer) – RFC (Response For Class) – LCOM4 (Lack Of Cohesion Methods) – DIT (Depth Of Inherentence Tree) – NOC – Number Of Children • CheckStyle (Adheres to Coding Standards)
  • 19. • PMD (Project Mess Detector) – Possible Bugs – Dead Code – SubOptimial Code – Complex Expressions • FindBugs (Static Analysis) – Malicious Code / Vulnerabilities
  • 20. • Cobertura & Clover – Based on Jcoverage java lib – %tage of Code Accessed by tests – Calculates Cyclomatic Complexity • FindBugs (Static Analysis) – Malicious Code / Vulnerabilities
  • 22. • Coding Standards • Potential Bugs • Documentation • Duplicated Code • Complexity • Test Coverage • Design & Arch – – Min Depend, Cohesion, Loose Coupling
  • 23. • SQUID (Core Analyser) – LCOM4 – Lack of Cohesion Methods – DIT – Dependency Of Inheritence Tree – NOC – No of Children • CheckStyle – Coding Standards – Duplication, – Memory Outage
  • 24. • PMD (Project Mess Detector) – Possible Bugs – Dead Code – Complex Expressions • Find Bugs – Static Analysis , Trace Bugs • Cobertura & Clover – Code Coverage
  • 26. • OpenSource • Quality Management Program. • More Than 600 Code Rules have been Integrated • Helps Detect Minor to Critical Defects • Drills Code Top to Bottom Watch the Quality Of Code Over Time
  • 27. • Eclipse Plugin • PDF Reports • Maven Ready • Extensible Plugin System
  • 28. References • http://aws.typepad.com • http://jenkins-ci.org/ • http://www.sonarsource.org/ • https://wiki.jenkins- ci.org/display/JENKINS/Jenkins+Script+Consol e
  • 29. Sonar Jenkins HandsOn Mak Bhatamrekar github :http://github.com/makrand-bkar twitter : mak-bkar url : www.careerinjava.com http://meetup.com/my-ajcp Atlanta Java Concept Pros

Editor's Notes

  • #3: Whats the Problem we are trying to solve