SlideShare uma empresa Scribd logo
1 de 38
Baixar para ler offline
My "Perfect" Toolchain
Setup for Grails Projects
   Stefan Armbruster
     netjay GmbH & Co. KG
about me
●   located in Munich/Germany
●   freelancer since +10 years
●   cofounder of Netjay
●   Java +10 years, Groovy ~5 years, Grails 3+ years
●   +3 years Neo4j experience, involved in the community
●   author of some Grails plugins and Neo4j-Grails integration plugin
●   passionate volunteer firefighter

●   @darthvader42
●   http://blog.armbruster-it.de
We're hiring




http://www.netjay.de/job.html
Compare developing
 a Grails application
    with cooking
Tools you'll need
Software engineering process
●



Ticketing system
●



Editor / IDE
●



Version control / branching model
●



continuous integration
●



Automated deployments
●



Load testing / Profiling
●
Education science
Only hear            20 %

Only see             30 %

See and hear         50 %

See, hear and discuss 70 %

See, hear, discuss and 90%
do-it-yourself
About this workshop
Let's create a small application
●



Setup all tooling
●



Deliver today !
●



For server side tools:
●


    – Ubuntu 12.04 image as VM image
    – Login: dev / 12345dev!
Developer's laptop:
●


    – JDK, Grails, Virtualbox, IntelliJ, git
Introducing demo project: gr8shop
Small shopping application
●



Simple use-cases
●


     ●
         As a shopmanager I want to CRUD my products so
          the customers can buy something
     ●
         As a customer I want to put products in my shopping
          cart to buy them
     ●
         As a customer I want my shopping cart to be
          persistent so I can access it at a later timepoint
Choose a process
Scrum
●



Waterfall
●



RUP
●



Many more available
●



Combined with Kanban ?
●



None ;-)
●
Stefan's lessons learned
●   Team agreement on a DoD „defintion of done“:
        – Tested (unit, functional, ...)
        – Peer review
        – Documentation (how and where?)
●   Don't omit the physical taskboard
●   Do pair programming
        – on important things
        – If team skills differ
●   If you're not familiar with scrum, hire a good coach!
●   On start, get management committment and remember them
Ticketing systems / backlog tool
Single location for user stories
●



Support for non-local teammebers
●



We'll look at:
●


    – JIRA (https://gr8confdemo.atlassian.net)
          • Only available during workshop +2 weeks
    – Redmine
          • We'll install that in the dev server vm
Atlassian JIRA + Greenhopper
●
    Most powerful issue tracking system
●   Lots of plugins, great IDE integration
●
    Widely used (e.g. Grails itself uses Jira)
●   Not free for commercial use
●   Download as war or hosted product („Studio“)
●
    http://www.atlassian.com/software/jira/overview
●   Our demo instance: https://gr8confdemo.atlassian.net/
        – admin / gr8admin
        – dev / gr8dev
        – po / gr8po
Redmine
RoR based
●


Issues, wiki, news, documents, forum ....
●


SCM integration, lots of plugins
●


Debian/Ubuntu packages available
●


      sudo apt­get install redmine redmine­sqlite libapache2­
        mod­passenger
      Apache: copy contents of
      /usr/share/doc/redmine/examples/apache2­passenger­
       host.conf to /etc/apache2/sites­available/default


Access: http://<server>, user:admin, pw:admin
●
IDE matrix - YMMV
Name           Pros                                Cons
IntelliJ       •IDE with a strong focus on java    •You have to pay when used
               development                         commercially
               •„knows what you want to do“        •Learning curve

               •most advanced support for Grails   •Task integration

               (IMHO)
SpringSource   •Eclipse is widely adopted          More a set of plugins instead of a
                                                   •

Eclipse STS    •backed by SpringSource             well integrated monolith
               •free

               •rich Plugin ecosystem



Netbeans       ?                                   ?
Textmate       A lot of „gurus“ use it             Mac only
vi(m), emacs   •Everywhere available               •Not the easiest thing to learn
               •Uses very few resources            •Poor code assist

               •Only real programmers use vi



Sublime        ?                                   ?
Hints for IntelliJ
●
    Use the same codestyle settings for your team
        – esp. line seperator setting
●
    Learn keybindings, use „key promoter“ plugin
●
    When using Jira use Atlassian connector
●
    Some of my favourites:
        – Ctrl+W: semantic highlighting
        – Shelve/Unshelve
        – Run units test for Grails directly
        – Debugger
        – Zen coding support
SCM overview
You have the choie:
    – The old ones: diff/patch, RCS, CVS
    – The most used (currently): SVN
    – The hip ones: GIT, hg, bazaar, ... (DVCS's)
    – The PITAs: Perforce, M$ Sourcesafe, ...
Online repo providers:
    – Github, Bitbucket, Sourcforge, etc.
GIT: overview (kudos to @struberg)
GIT works similar to patch based systems
●



GIT is de-centralised: all changes are also available
●


 'offline'
GIT is distributed: changes can be pulled/pushed
●


 from/to remote repositories
All 'patches' are available locally
●



Commits are cryptographically strong
●
GIT concepts – object tree
●
    GIT always tracks the whole repository
●
    GIT tracks a tree containing diffs with their 'parents' and
     commit information
●
    .git/objects contains all those commits
●
    each commit has a unique sha1 containing the diff-object
     plus
●
    tree information, and further
●
    each commit has a unique sha1 containing the tree-object
     + commit info
●
    git 'packs' objects space optimized
GIT commit tree
●
    GIT doesn't work directly against the Repository but has a
     'preparation area' called 'Index'
●
    all changes prepared in that 'Index' will only get stored to the
      Repositories tree-objects with the 'commit'

                                                               upstream
                                                                repo1

                             I
                             N
               file          D             local
             change          E             repo
                             X
                                                               upstream
                                                                repo2
GIT documentation / tools
Docs:
    – Interactive cheatsheet http://ndpsoftware.com/git-cheatsheet.html
    – http://git-scm.com/documentation
    – http://gitcasts.com/
Tools:
    – Command line, gitk, giggle
    – IDE (IntelliJ, STS, netbeans)
    – Mac: git-tower
    – SmartGit (free for non-commercial)
git flow:
a branching model
Applys a practical proven
 branching model on top of git


develop: permanent branch,
 current development
master: permantent branch,
 holds stable releases
release: temporary branch for
 stabilizing/hardening prerelease
hotfix: temporary branch for
 bugfixing
git flow - setup
wget ­q – 
 http://github.com/nvie/gitflow/raw/develop/contrib/gitf
 low­installer.sh –no­check­certificate
sudo chmod a+x gitflow­installer.sh; sudo ./gitflow­
 installer.sh
Usage:
         cd <repo>; git flow init (use once)
         git flow feature [start|publish|finish|pull|list]
         git flow release [start|publish|finish]
         git flow hotfix [start|finish]
GIT tips
Choose .gitignore carefully:
●


    – https://github.com/github/gitignore/raw/master/Grails.gitignore
    – Consider adding IDE control files ?
Team agreement on commit messages
●


    – e.g. „refs/closes #<id>: [NEW|FIX|CON|ETF] <msg>“
Rebase is powerful, but do not rebase pushed stuff!
●
Remote repo manager: gitolite
GIT by itself has no security or authentication
●



Gitolite uses ssh for this
●



apt­get install gitolite, provide admin key
●



Clone admin repo:
●


    – git clone gitolite@<hostname>:gitolite­admin.git
    – Add public ssh keys to keys/
    – Setup project in conf/gitolite.conf
    – Commit & push
Publish gr8shop
Connect local repo to remote (only once)
●


    – git remote add origin 
       gitolite@<hostname>:gr8shop.git
git push –all
●



Other team mates:
●


    – git clone 
       gitolite@<hostname>:gr8shop.git
Setup CI: Jenkins
apt-get install jenkins-tomcat
●


    – http://<hostname>:8080/jenkins
Install some plugins:
●


    – Chuck Norris (you can't live without it!)
    – Grails (obvious)
    – Git
    – Violations
    – Maven
    – Deploy
Jenkins
Configure multiple small dependent jobs instead of 1 huge job
●


    – Faster response when something goes wrong
Let git postreceive hook trigger jenkins instead of jenkins querying git
●

 every x minutes
    – Jenkins must be security enabled
    – Use external trigger in job's config
    – Postreceive hook for git:
      curl "http://admin:admin@localhost:8080/jenkins/job/gr8shop_unittests/build?
        token=abc"

Parameterize deploy job with a git refspec
●
Functional tests
Killer combo for testing: Spock + Geb
●



Demoing...
●



For running Geb tests on Jenkins: either use:
●


    – RemoteWebDriver,
    – HtmlUnit driver, or
    – [Firefox,Chrome] + Xvnc plugin, see
         • http://www.rapaul.com/2011/06/05/zero-to-headless-
             browser-tests-jenkins/
Code quality
Use codenarc plugin
●



Apply to grails-app/conf:
●


      codenarc {
          reportName = 'target/test­reports/CodeNarcReport.xml'
          reportType = 'xml'
          propertiesFile = 'grails­app/conf/codenarc.properties'
      }

And Jenkins' violation plugin:
●


    – „Report violations, codenarc“:
            target/test-reports/CodeNarcReport.xml
Loadtesting
Demoing jmeter....


Alternatives:
    – Grinder
    – HP LoadRunner (if you have too much $$$)
Profiling
Demoing Yourkit Profiler


Alternatives
    – JVisualVM
    – JDK's command line tools (jmap/jhat/jstat/jstack)
    – Netbeans Profiler
Need to modify existing plugin?
Fork the plugin on github
●



Use git submodule to nest the fork in your project
●



Inline the plugin
●



Think of contributing your plugin changes!
●



My blog post for this: http://bit.ly/pwahJ1
●
Kudos / references

Boris Gloger's scrum checklist:
●


 http://www.infoq.com/minibooks/scrum-checklists
http://farm4.staticflickr.com/3241/3130372498_c1e0812548_z.jpg?zz=1
●



http://farm4.staticflickr.com/3482/3456875252_ee129a8dbf_b.jpg
●



http://farm4.staticflickr.com/3117/2585841913_699976a643_b.jpg
●



http://nvie.com/posts/a-successful-git-branching-model/
●



http://yakiloo.com/getting-started-git-flow/
●



http://ndpsoftware.com/git-cheatsheet.html
●

Mais conteúdo relacionado

Mais procurados

GR8Conf 2011: Grails, how to plug in
GR8Conf 2011: Grails, how to plug inGR8Conf 2011: Grails, how to plug in
GR8Conf 2011: Grails, how to plug in
GR8Conf
 
Gradle - time for a new build
Gradle - time for a new buildGradle - time for a new build
Gradle - time for a new build
Igor Khotin
 
Developing Mobile HTML5 Apps with Grails
Developing Mobile HTML5 Apps with GrailsDeveloping Mobile HTML5 Apps with Grails
Developing Mobile HTML5 Apps with Grails
GR8Conf
 
Java(ee) mongo db applications in the cloud
Java(ee) mongo db applications in the cloud Java(ee) mongo db applications in the cloud
Java(ee) mongo db applications in the cloud
Shekhar Gulati
 
A year in the life of a Grails startup
A year in the life of a Grails startupA year in the life of a Grails startup
A year in the life of a Grails startup
tomaslin
 

Mais procurados (20)

GR8Conf 2011: Grails, how to plug in
GR8Conf 2011: Grails, how to plug inGR8Conf 2011: Grails, how to plug in
GR8Conf 2011: Grails, how to plug in
 
Faster java ee builds with gradle [con4921]
Faster java ee builds with gradle [con4921]Faster java ee builds with gradle [con4921]
Faster java ee builds with gradle [con4921]
 
Scala and Play with Gradle
Scala and Play with GradleScala and Play with Gradle
Scala and Play with Gradle
 
Gradle - time for a new build
Gradle - time for a new buildGradle - time for a new build
Gradle - time for a new build
 
An introduction to maven gradle and sbt
An introduction to maven gradle and sbtAn introduction to maven gradle and sbt
An introduction to maven gradle and sbt
 
Developing Mobile HTML5 Apps with Grails
Developing Mobile HTML5 Apps with GrailsDeveloping Mobile HTML5 Apps with Grails
Developing Mobile HTML5 Apps with Grails
 
Why jakarta ee matters (ConFoo 2021)
Why jakarta ee matters (ConFoo 2021)Why jakarta ee matters (ConFoo 2021)
Why jakarta ee matters (ConFoo 2021)
 
Introduction to gradle
Introduction to gradleIntroduction to gradle
Introduction to gradle
 
Angular beans
Angular beansAngular beans
Angular beans
 
Micronaut: Changing the Micro Future
Micronaut: Changing the Micro FutureMicronaut: Changing the Micro Future
Micronaut: Changing the Micro Future
 
Gradle - the Enterprise Automation Tool
Gradle  - the Enterprise Automation ToolGradle  - the Enterprise Automation Tool
Gradle - the Enterprise Automation Tool
 
Micronaut For Single Page Apps
Micronaut For Single Page AppsMicronaut For Single Page Apps
Micronaut For Single Page Apps
 
Android gradle-build-system-overview
Android gradle-build-system-overviewAndroid gradle-build-system-overview
Android gradle-build-system-overview
 
Grails 3.0 Preview
Grails 3.0 PreviewGrails 3.0 Preview
Grails 3.0 Preview
 
Building with Gradle
Building with GradleBuilding with Gradle
Building with Gradle
 
Apache Lucene for Java EE Developers
Apache Lucene for Java EE DevelopersApache Lucene for Java EE Developers
Apache Lucene for Java EE Developers
 
Gradle Introduction
Gradle IntroductionGradle Introduction
Gradle Introduction
 
Gradle
GradleGradle
Gradle
 
Java(ee) mongo db applications in the cloud
Java(ee) mongo db applications in the cloud Java(ee) mongo db applications in the cloud
Java(ee) mongo db applications in the cloud
 
A year in the life of a Grails startup
A year in the life of a Grails startupA year in the life of a Grails startup
A year in the life of a Grails startup
 

Semelhante a My "Perfect" Toolchain Setup for Grails Projects

Semelhante a My "Perfect" Toolchain Setup for Grails Projects (20)

Deploying software at Scale
Deploying software at ScaleDeploying software at Scale
Deploying software at Scale
 
Django dev-env-my-way
Django dev-env-my-wayDjango dev-env-my-way
Django dev-env-my-way
 
GeoServer Developers Workshop
GeoServer Developers WorkshopGeoServer Developers Workshop
GeoServer Developers Workshop
 
Rejekts 24 EU No GitOps Pain, No Platform Gain
Rejekts 24 EU No GitOps Pain, No Platform GainRejekts 24 EU No GitOps Pain, No Platform Gain
Rejekts 24 EU No GitOps Pain, No Platform Gain
 
Nagios Conference 2014 - Spenser Reinhardt - Detecting Security Breaches With...
Nagios Conference 2014 - Spenser Reinhardt - Detecting Security Breaches With...Nagios Conference 2014 - Spenser Reinhardt - Detecting Security Breaches With...
Nagios Conference 2014 - Spenser Reinhardt - Detecting Security Breaches With...
 
Lupus Decoupled Drupal - Drupal Austria Meetup - 2023-04.pdf
Lupus Decoupled Drupal - Drupal Austria Meetup - 2023-04.pdfLupus Decoupled Drupal - Drupal Austria Meetup - 2023-04.pdf
Lupus Decoupled Drupal - Drupal Austria Meetup - 2023-04.pdf
 
Introduction to git & github
Introduction to git & githubIntroduction to git & github
Introduction to git & github
 
Source Control with Domino Designer 8.5.3 and Git (DanNotes, November 28, 2012)
Source Control with Domino Designer 8.5.3 and Git (DanNotes, November 28, 2012)Source Control with Domino Designer 8.5.3 and Git (DanNotes, November 28, 2012)
Source Control with Domino Designer 8.5.3 and Git (DanNotes, November 28, 2012)
 
Mono Repo
Mono RepoMono Repo
Mono Repo
 
Git In One Evening
Git In One EveningGit In One Evening
Git In One Evening
 
How to plan and define your CI-CD pipeline
How to plan and define your CI-CD pipelineHow to plan and define your CI-CD pipeline
How to plan and define your CI-CD pipeline
 
Introduction to Docker at SF Peninsula Software Development Meetup @Guidewire
Introduction to Docker at SF Peninsula Software Development Meetup @GuidewireIntroduction to Docker at SF Peninsula Software Development Meetup @Guidewire
Introduction to Docker at SF Peninsula Software Development Meetup @Guidewire
 
Devoops: DoJ Annual Cybersecurity Training Symposium Edition 2015
Devoops: DoJ Annual Cybersecurity Training Symposium Edition 2015Devoops: DoJ Annual Cybersecurity Training Symposium Edition 2015
Devoops: DoJ Annual Cybersecurity Training Symposium Edition 2015
 
Pluggable Infrastructure with CI/CD and Docker
Pluggable Infrastructure with CI/CD and DockerPluggable Infrastructure with CI/CD and Docker
Pluggable Infrastructure with CI/CD and Docker
 
Drupal Best Practices
Drupal Best PracticesDrupal Best Practices
Drupal Best Practices
 
Automate your WordPress Workflow with Grunt.js
Automate your WordPress Workflow with Grunt.jsAutomate your WordPress Workflow with Grunt.js
Automate your WordPress Workflow with Grunt.js
 
Open up your platform with Open Source and GitHub
Open up your platform with Open Source and GitHubOpen up your platform with Open Source and GitHub
Open up your platform with Open Source and GitHub
 
Towards Continuous Deployment with Django
Towards Continuous Deployment with DjangoTowards Continuous Deployment with Django
Towards Continuous Deployment with Django
 
Go at Skroutz
Go at SkroutzGo at Skroutz
Go at Skroutz
 
Extending OpenShift Origin: Build Your Own Cartridge with Bill DeCoste of Red...
Extending OpenShift Origin: Build Your Own Cartridge with Bill DeCoste of Red...Extending OpenShift Origin: Build Your Own Cartridge with Bill DeCoste of Red...
Extending OpenShift Origin: Build Your Own Cartridge with Bill DeCoste of Red...
 

Mais de GR8Conf

Mais de GR8Conf (20)

DevOps Enabling Your Team
DevOps Enabling Your TeamDevOps Enabling Your Team
DevOps Enabling Your Team
 
Creating and testing REST contracts with Accurest Gradle
Creating and testing REST contracts with Accurest Gradle Creating and testing REST contracts with Accurest Gradle
Creating and testing REST contracts with Accurest Gradle
 
Mum, I want to be a Groovy full-stack developer
Mum, I want to be a Groovy full-stack developerMum, I want to be a Groovy full-stack developer
Mum, I want to be a Groovy full-stack developer
 
Metaprogramming with Groovy
Metaprogramming with GroovyMetaprogramming with Groovy
Metaprogramming with Groovy
 
Scraping with Geb
Scraping with GebScraping with Geb
Scraping with Geb
 
How to create a conference android app with Groovy and Android
How to create a conference android app with Groovy and AndroidHow to create a conference android app with Groovy and Android
How to create a conference android app with Groovy and Android
 
Ratpack On the Docks
Ratpack On the DocksRatpack On the Docks
Ratpack On the Docks
 
Groovy Powered Clean Code
Groovy Powered Clean CodeGroovy Powered Clean Code
Groovy Powered Clean Code
 
Cut your Grails application to pieces - build feature plugins
Cut your Grails application to pieces - build feature pluginsCut your Grails application to pieces - build feature plugins
Cut your Grails application to pieces - build feature plugins
 
Performance tuning Grails applications
 Performance tuning Grails applications Performance tuning Grails applications
Performance tuning Grails applications
 
Ratpack and Grails 3
 Ratpack and Grails 3 Ratpack and Grails 3
Ratpack and Grails 3
 
Grails & DevOps: continuous integration and delivery in the cloud
Grails & DevOps: continuous integration and delivery in the cloudGrails & DevOps: continuous integration and delivery in the cloud
Grails & DevOps: continuous integration and delivery in the cloud
 
Functional testing your Grails app with GEB
Functional testing your Grails app with GEBFunctional testing your Grails app with GEB
Functional testing your Grails app with GEB
 
Deploying, Scaling, and Running Grails on AWS and VPC
Deploying, Scaling, and Running Grails on AWS and VPCDeploying, Scaling, and Running Grails on AWS and VPC
Deploying, Scaling, and Running Grails on AWS and VPC
 
The Grails introduction workshop
The Grails introduction workshopThe Grails introduction workshop
The Grails introduction workshop
 
Idiomatic spock
Idiomatic spockIdiomatic spock
Idiomatic spock
 
The Groovy Ecosystem Revisited
The Groovy Ecosystem RevisitedThe Groovy Ecosystem Revisited
The Groovy Ecosystem Revisited
 
Groovy 3 and the new Groovy Meta Object Protocol in examples
Groovy 3 and the new Groovy Meta Object Protocol in examplesGroovy 3 and the new Groovy Meta Object Protocol in examples
Groovy 3 and the new Groovy Meta Object Protocol in examples
 
Integration using Apache Camel and Groovy
Integration using Apache Camel and GroovyIntegration using Apache Camel and Groovy
Integration using Apache Camel and Groovy
 
CRaSH the shell for the Java Virtual Machine
CRaSH the shell for the Java Virtual MachineCRaSH the shell for the Java Virtual Machine
CRaSH the shell for the Java Virtual Machine
 

Último

Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and Myths
Joaquim Jorge
 
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slide
vu2urc
 

Último (20)

ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
 
GenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdfGenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdf
 
Evaluating the top large language models.pdf
Evaluating the top large language models.pdfEvaluating the top large language models.pdf
Evaluating the top large language models.pdf
 
Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and Myths
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024
 
Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...
 
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot TakeoffStrategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
 
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slide
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdf
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf
 
What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?
 
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processors
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivity
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreter
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)
 
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
 

My "Perfect" Toolchain Setup for Grails Projects

  • 1. My "Perfect" Toolchain Setup for Grails Projects Stefan Armbruster netjay GmbH & Co. KG
  • 2. about me ● located in Munich/Germany ● freelancer since +10 years ● cofounder of Netjay ● Java +10 years, Groovy ~5 years, Grails 3+ years ● +3 years Neo4j experience, involved in the community ● author of some Grails plugins and Neo4j-Grails integration plugin ● passionate volunteer firefighter ● @darthvader42 ● http://blog.armbruster-it.de
  • 4. Compare developing a Grails application with cooking
  • 5.
  • 6.
  • 7.
  • 8. Tools you'll need Software engineering process ● Ticketing system ● Editor / IDE ● Version control / branching model ● continuous integration ● Automated deployments ● Load testing / Profiling ●
  • 9. Education science Only hear 20 % Only see 30 % See and hear 50 % See, hear and discuss 70 % See, hear, discuss and 90% do-it-yourself
  • 10. About this workshop Let's create a small application ● Setup all tooling ● Deliver today ! ● For server side tools: ● – Ubuntu 12.04 image as VM image – Login: dev / 12345dev! Developer's laptop: ● – JDK, Grails, Virtualbox, IntelliJ, git
  • 11. Introducing demo project: gr8shop Small shopping application ● Simple use-cases ● ● As a shopmanager I want to CRUD my products so the customers can buy something ● As a customer I want to put products in my shopping cart to buy them ● As a customer I want my shopping cart to be persistent so I can access it at a later timepoint
  • 12. Choose a process Scrum ● Waterfall ● RUP ● Many more available ● Combined with Kanban ? ● None ;-) ●
  • 13.
  • 14. Stefan's lessons learned ● Team agreement on a DoD „defintion of done“: – Tested (unit, functional, ...) – Peer review – Documentation (how and where?) ● Don't omit the physical taskboard ● Do pair programming – on important things – If team skills differ ● If you're not familiar with scrum, hire a good coach! ● On start, get management committment and remember them
  • 15. Ticketing systems / backlog tool Single location for user stories ● Support for non-local teammebers ● We'll look at: ● – JIRA (https://gr8confdemo.atlassian.net) • Only available during workshop +2 weeks – Redmine • We'll install that in the dev server vm
  • 16. Atlassian JIRA + Greenhopper ● Most powerful issue tracking system ● Lots of plugins, great IDE integration ● Widely used (e.g. Grails itself uses Jira) ● Not free for commercial use ● Download as war or hosted product („Studio“) ● http://www.atlassian.com/software/jira/overview ● Our demo instance: https://gr8confdemo.atlassian.net/ – admin / gr8admin – dev / gr8dev – po / gr8po
  • 17. Redmine RoR based ● Issues, wiki, news, documents, forum .... ● SCM integration, lots of plugins ● Debian/Ubuntu packages available ● sudo apt­get install redmine redmine­sqlite libapache2­ mod­passenger Apache: copy contents of /usr/share/doc/redmine/examples/apache2­passenger­ host.conf to /etc/apache2/sites­available/default Access: http://<server>, user:admin, pw:admin ●
  • 18. IDE matrix - YMMV Name Pros Cons IntelliJ •IDE with a strong focus on java •You have to pay when used development commercially •„knows what you want to do“ •Learning curve •most advanced support for Grails •Task integration (IMHO) SpringSource •Eclipse is widely adopted More a set of plugins instead of a • Eclipse STS •backed by SpringSource well integrated monolith •free •rich Plugin ecosystem Netbeans ? ? Textmate A lot of „gurus“ use it Mac only vi(m), emacs •Everywhere available •Not the easiest thing to learn •Uses very few resources •Poor code assist •Only real programmers use vi Sublime ? ?
  • 19. Hints for IntelliJ ● Use the same codestyle settings for your team – esp. line seperator setting ● Learn keybindings, use „key promoter“ plugin ● When using Jira use Atlassian connector ● Some of my favourites: – Ctrl+W: semantic highlighting – Shelve/Unshelve – Run units test for Grails directly – Debugger – Zen coding support
  • 20. SCM overview You have the choie: – The old ones: diff/patch, RCS, CVS – The most used (currently): SVN – The hip ones: GIT, hg, bazaar, ... (DVCS's) – The PITAs: Perforce, M$ Sourcesafe, ... Online repo providers: – Github, Bitbucket, Sourcforge, etc.
  • 21. GIT: overview (kudos to @struberg) GIT works similar to patch based systems ● GIT is de-centralised: all changes are also available ● 'offline' GIT is distributed: changes can be pulled/pushed ● from/to remote repositories All 'patches' are available locally ● Commits are cryptographically strong ●
  • 22. GIT concepts – object tree ● GIT always tracks the whole repository ● GIT tracks a tree containing diffs with their 'parents' and commit information ● .git/objects contains all those commits ● each commit has a unique sha1 containing the diff-object plus ● tree information, and further ● each commit has a unique sha1 containing the tree-object + commit info ● git 'packs' objects space optimized
  • 24. GIT doesn't work directly against the Repository but has a 'preparation area' called 'Index' ● all changes prepared in that 'Index' will only get stored to the Repositories tree-objects with the 'commit' upstream repo1 I N file D local change E repo X upstream repo2
  • 25. GIT documentation / tools Docs: – Interactive cheatsheet http://ndpsoftware.com/git-cheatsheet.html – http://git-scm.com/documentation – http://gitcasts.com/ Tools: – Command line, gitk, giggle – IDE (IntelliJ, STS, netbeans) – Mac: git-tower – SmartGit (free for non-commercial)
  • 26. git flow: a branching model Applys a practical proven branching model on top of git develop: permanent branch, current development master: permantent branch, holds stable releases release: temporary branch for stabilizing/hardening prerelease hotfix: temporary branch for bugfixing
  • 27. git flow - setup wget ­q –  http://github.com/nvie/gitflow/raw/develop/contrib/gitf low­installer.sh –no­check­certificate sudo chmod a+x gitflow­installer.sh; sudo ./gitflow­ installer.sh Usage: cd <repo>; git flow init (use once) git flow feature [start|publish|finish|pull|list] git flow release [start|publish|finish] git flow hotfix [start|finish]
  • 28. GIT tips Choose .gitignore carefully: ● – https://github.com/github/gitignore/raw/master/Grails.gitignore – Consider adding IDE control files ? Team agreement on commit messages ● – e.g. „refs/closes #<id>: [NEW|FIX|CON|ETF] <msg>“ Rebase is powerful, but do not rebase pushed stuff! ●
  • 29. Remote repo manager: gitolite GIT by itself has no security or authentication ● Gitolite uses ssh for this ● apt­get install gitolite, provide admin key ● Clone admin repo: ● – git clone gitolite@<hostname>:gitolite­admin.git – Add public ssh keys to keys/ – Setup project in conf/gitolite.conf – Commit & push
  • 30. Publish gr8shop Connect local repo to remote (only once) ● – git remote add origin  gitolite@<hostname>:gr8shop.git git push –all ● Other team mates: ● – git clone  gitolite@<hostname>:gr8shop.git
  • 31. Setup CI: Jenkins apt-get install jenkins-tomcat ● – http://<hostname>:8080/jenkins Install some plugins: ● – Chuck Norris (you can't live without it!) – Grails (obvious) – Git – Violations – Maven – Deploy
  • 32. Jenkins Configure multiple small dependent jobs instead of 1 huge job ● – Faster response when something goes wrong Let git postreceive hook trigger jenkins instead of jenkins querying git ● every x minutes – Jenkins must be security enabled – Use external trigger in job's config – Postreceive hook for git: curl "http://admin:admin@localhost:8080/jenkins/job/gr8shop_unittests/build? token=abc" Parameterize deploy job with a git refspec ●
  • 33. Functional tests Killer combo for testing: Spock + Geb ● Demoing... ● For running Geb tests on Jenkins: either use: ● – RemoteWebDriver, – HtmlUnit driver, or – [Firefox,Chrome] + Xvnc plugin, see • http://www.rapaul.com/2011/06/05/zero-to-headless- browser-tests-jenkins/
  • 34. Code quality Use codenarc plugin ● Apply to grails-app/conf: ● codenarc {     reportName = 'target/test­reports/CodeNarcReport.xml'     reportType = 'xml'     propertiesFile = 'grails­app/conf/codenarc.properties' } And Jenkins' violation plugin: ● – „Report violations, codenarc“: target/test-reports/CodeNarcReport.xml
  • 35. Loadtesting Demoing jmeter.... Alternatives: – Grinder – HP LoadRunner (if you have too much $$$)
  • 36. Profiling Demoing Yourkit Profiler Alternatives – JVisualVM – JDK's command line tools (jmap/jhat/jstat/jstack) – Netbeans Profiler
  • 37. Need to modify existing plugin? Fork the plugin on github ● Use git submodule to nest the fork in your project ● Inline the plugin ● Think of contributing your plugin changes! ● My blog post for this: http://bit.ly/pwahJ1 ●
  • 38. Kudos / references Boris Gloger's scrum checklist: ● http://www.infoq.com/minibooks/scrum-checklists http://farm4.staticflickr.com/3241/3130372498_c1e0812548_z.jpg?zz=1 ● http://farm4.staticflickr.com/3482/3456875252_ee129a8dbf_b.jpg ● http://farm4.staticflickr.com/3117/2585841913_699976a643_b.jpg ● http://nvie.com/posts/a-successful-git-branching-model/ ● http://yakiloo.com/getting-started-git-flow/ ● http://ndpsoftware.com/git-cheatsheet.html ●