• Share
  • Email
  • Embed
  • Like
  • Save
  • Private Content
My "Perfect" Toolchain Setup for Grails Projects
 

My "Perfect" Toolchain Setup for Grails Projects

on

  • 3,988 views

Presentationslides from the GR8Conf presentation. Find the abstract here:

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

Statistics

Views

Total Views
3,988
Views on SlideShare
3,597
Embed Views
391

Actions

Likes
6
Downloads
56
Comments
2

10 Embeds 391

http://gr8conf.eu 193
https://twitter.com 141
http://lanyrd.com 22
http://gr8conf.org 13
http://localhost 9
http://eventifier.co 9
http://translate.googleusercontent.com 1
https://www.rebelmouse.com 1
http://www.google.com.sa 1
http://eventifier.com 1
More...

Accessibility

Categories

Upload Details

Uploaded via as Adobe PDF

Usage Rights

© All Rights Reserved

Report content

Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel

12 of 2 previous next

  • Full Name Full Name Comment goes here.
    Are you sure you want to
    Your message goes here
    Processing…
Post Comment
Edit your comment

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

    • 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 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
    • 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 integration●Automated deployments●Load testing / Profiling●
    • Education scienceOnly hear 20 %Only see 30 %See and hear 50 %See, hear and discuss 70 %See, hear, discuss and 90%do-it-yourself
    • 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
    • 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
    • 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, ...) – 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
    • 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
    • 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
    • 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●
    • 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 ? ?
    • 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 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.
    • 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●
    • 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 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
    • 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)
    • 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
    • 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]
    • 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!●
    • 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
    • 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
    • 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
    • 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●
    • 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/
    • 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
    • LoadtestingDemoing jmeter....Alternatives: – Grinder – HP LoadRunner (if you have too much $$$)
    • ProfilingDemoing Yourkit ProfilerAlternatives – JVisualVM – JDKs 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 / 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●