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
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
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 aptget install redmine redminesqlite libapache2
modpassenger
Apache: copy contents of
/usr/share/doc/redmine/examples/apache2passenger
host.conf to /etc/apache2/sitesavailable/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
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
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
●
aptget install gitolite, provide admin key
●
Clone admin repo:
●
– git clone gitolite@<hostname>:gitoliteadmin.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
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/
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
●