Your SlideShare is downloading. ×
0
My "Perfect" ToolchainSetup 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 ye...
Were hiringhttp://www.netjay.de/job.html
Compare developing a Grails application    with cooking
Tools youll needSoftware engineering process●Ticketing system●Editor / IDE●Version control / branching model●continuous in...
Education scienceOnly hear            20 %Only see             30 %See and hear         50 %See, hear and discuss 70 %See,...
About this workshopLets create a small application●Setup all tooling●Deliver today !●For server side tools:●    – Ubuntu 1...
Introducing demo project: gr8shopSmall shopping application●Simple use-cases●     ●         As a shopmanager I want to CRU...
Choose a processScrum●Waterfall●RUP●Many more available●Combined with Kanban ?●None ;-)●
Stefans lessons learned●   Team agreement on a DoD „defintion of done“:        – Tested (unit, functional, ...)        – P...
Ticketing systems / backlog toolSingle location for user stories●Support for non-local teammebers●Well look at:●    – JIRA...
Atlassian JIRA + Greenhopper●    Most powerful issue tracking system●   Lots of plugins, great IDE integration●    Widely ...
RedmineRoR based●Issues, wiki, news, documents, forum ....●SCM integration, lots of plugins●Debian/Ubuntu packages availab...
IDE matrix - YMMVName           Pros                                ConsIntelliJ       •IDE with a strong focus on java   ...
Hints for IntelliJ●    Use the same codestyle settings for your team        – esp. line seperator setting●    Learn keybin...
SCM overviewYou have the choie:    – The old ones: diff/patch, RCS, CVS    – The most used (currently): SVN    – The hip o...
GIT: overview (kudos to @struberg)GIT works similar to patch based systems●GIT is de-centralised: all changes are also ava...
GIT concepts – object tree●    GIT always tracks the whole repository●    GIT tracks a tree containing diffs with their pa...
GIT commit tree
●    GIT doesnt work directly against the Repository but has a     preparation area called Index●    all changes prepared ...
GIT documentation / toolsDocs:    – Interactive cheatsheet http://ndpsoftware.com/git-cheatsheet.html    – http://git-scm....
git flow:a branching modelApplys a practical proven branching model on top of gitdevelop: permanent branch, current develo...
git flow - setupwget ­q –  http://github.com/nvie/gitflow/raw/develop/contrib/gitf low­installer.sh –no­check­certificates...
GIT tipsChoose .gitignore carefully:●    – https://github.com/github/gitignore/raw/master/Grails.gitignore    – Consider a...
Remote repo manager: gitoliteGIT by itself has no security or authentication●Gitolite uses ssh for this●apt­get install gi...
Publish gr8shopConnect local repo to remote (only once)●    – git remote add origin        gitolite@<hostname>:gr8shop.git...
Setup CI: Jenkinsapt-get install jenkins-tomcat●    – http://<hostname>:8080/jenkinsInstall some plugins:●    – Chuck Norr...
JenkinsConfigure multiple small dependent jobs instead of 1 huge job●    – Faster response when something goes wrongLet gi...
Functional testsKiller combo for testing: Spock + Geb●Demoing...●For running Geb tests on Jenkins: either use:●    – Remot...
Code qualityUse codenarc plugin●Apply to grails-app/conf:●      codenarc {          reportName = target/test­reports/CodeN...
LoadtestingDemoing jmeter....Alternatives:    – Grinder    – HP LoadRunner (if you have too much $$$)
ProfilingDemoing Yourkit ProfilerAlternatives    – JVisualVM    – JDKs command line tools (jmap/jhat/jstat/jstack)    – Ne...
Need to modify existing plugin?Fork the plugin on github●Use git submodule to nest the fork in your project●Inline the plu...
Kudos / referencesBoris Glogers scrum checklist:● http://www.infoq.com/minibooks/scrum-checklistshttp://farm4.staticflickr...
My "Perfect" Toolchain Setup for Grails Projects
My "Perfect" Toolchain Setup for Grails Projects
My "Perfect" Toolchain Setup for Grails Projects
My "Perfect" Toolchain Setup for Grails Projects
Upcoming SlideShare
Loading in...5
×

My "Perfect" Toolchain Setup for Grails Projects

4,147

Published on

Presentationslides from the GR8Conf presentation. Find the abstract here:
http://gr8conf.eu/Presentations/my-perfect-grails-toolchain

Published in: Technology
2 Comments
7 Likes
Statistics
Notes
No Downloads
Views
Total Views
4,147
On Slideshare
0
From Embeds
0
Number of Embeds
7
Actions
Shares
0
Downloads
66
Comments
2
Likes
7
Embeds 0
No embeds

No notes for slide

Transcript of "My "Perfect" Toolchain Setup for Grails Projects"

  1. 1. My "Perfect" ToolchainSetup for Grails Projects Stefan Armbruster netjay GmbH & Co. KG
  2. 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
  3. 3. Were hiringhttp://www.netjay.de/job.html
  4. 4. Compare developing a Grails application with cooking
  5. 5. Tools youll needSoftware engineering process●Ticketing system●Editor / IDE●Version control / branching model●continuous integration●Automated deployments●Load testing / Profiling●
  6. 6. Education scienceOnly hear 20 %Only see 30 %See and hear 50 %See, hear and discuss 70 %See, hear, discuss and 90%do-it-yourself
  7. 7. About this workshopLets create a small application●Setup all tooling●Deliver today !●For server side tools:● – Ubuntu 12.04 image as VM image – Login: dev / 12345dev!Developers laptop:● – JDK, Grails, Virtualbox, IntelliJ, git
  8. 8. Introducing demo project: gr8shopSmall 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
  9. 9. Choose a processScrum●Waterfall●RUP●Many more available●Combined with Kanban ?●None ;-)●
  10. 10. Stefans lessons learned● Team agreement on a DoD „defintion of done“: – Tested (unit, functional, ...) – Peer review – Documentation (how and where?)● Dont omit the physical taskboard● Do pair programming – on important things – If team skills differ● If youre not familiar with scrum, hire a good coach!● On start, get management committment and remember them
  11. 11. Ticketing systems / backlog toolSingle location for user stories●Support for non-local teammebers●Well look at:● – JIRA (https://gr8confdemo.atlassian.net) • Only available during workshop +2 weeks – Redmine • Well install that in the dev server vm
  12. 12. 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
  13. 13. RedmineRoR 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/defaultAccess: http://<server>, user:admin, pw:admin●
  14. 14. IDE matrix - YMMVName Pros ConsIntelliJ •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 ecosystemNetbeans ? ?Textmate A lot of „gurus“ use it Mac onlyvi(m), emacs •Everywhere available •Not the easiest thing to learn •Uses very few resources •Poor code assist •Only real programmers use viSublime ? ?
  15. 15. 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
  16. 16. SCM overviewYou have the choie: – The old ones: diff/patch, RCS, CVS – The most used (currently): SVN – The hip ones: GIT, hg, bazaar, ... (DVCSs) – The PITAs: Perforce, M$ Sourcesafe, ...Online repo providers: – Github, Bitbucket, Sourcforge, etc.
  17. 17. GIT: overview (kudos to @struberg)GIT works similar to patch based systems●GIT is de-centralised: all changes are also available● offlineGIT is distributed: changes can be pulled/pushed● from/to remote repositoriesAll patches are available locally●Commits are cryptographically strong●
  18. 18. 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
  19. 19. GIT commit tree
  20. 20. ● GIT doesnt 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
  21. 21. GIT documentation / toolsDocs: – 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)
  22. 22. git flow:a branching modelApplys a practical proven branching model on top of gitdevelop: permanent branch, current developmentmaster: permantent branch, holds stable releasesrelease: temporary branch for stabilizing/hardening prereleasehotfix: temporary branch for bugfixing
  23. 23. git flow - setupwget ­q –  http://github.com/nvie/gitflow/raw/develop/contrib/gitf low­installer.sh –no­check­certificatesudo chmod a+x gitflow­installer.sh; sudo ./gitflow­ installer.shUsage: 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]
  24. 24. GIT tipsChoose .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!●
  25. 25. Remote repo manager: gitoliteGIT 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
  26. 26. Publish gr8shopConnect local repo to remote (only once)● – git remote add origin  gitolite@<hostname>:gr8shop.gitgit push –all●Other team mates:● – git clone  gitolite@<hostname>:gr8shop.git
  27. 27. Setup CI: Jenkinsapt-get install jenkins-tomcat● – http://<hostname>:8080/jenkinsInstall some plugins:● – Chuck Norris (you cant live without it!) – Grails (obvious) – Git – Violations – Maven – Deploy
  28. 28. JenkinsConfigure multiple small dependent jobs instead of 1 huge job● – Faster response when something goes wrongLet git postreceive hook trigger jenkins instead of jenkins querying git● every x minutes – Jenkins must be security enabled – Use external trigger in jobs 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●
  29. 29. Functional testsKiller 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/
  30. 30. Code qualityUse 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
  31. 31. LoadtestingDemoing jmeter....Alternatives: – Grinder – HP LoadRunner (if you have too much $$$)
  32. 32. ProfilingDemoing Yourkit ProfilerAlternatives – JVisualVM – JDKs command line tools (jmap/jhat/jstat/jstack) – Netbeans Profiler
  33. 33. 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●
  34. 34. Kudos / referencesBoris Glogers scrum checklist:● http://www.infoq.com/minibooks/scrum-checklistshttp://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●
  1. A particular slide catching your eye?

    Clipping is a handy way to collect important slides you want to go back to later.

×