Beruflich Dokumente
Kultur Dokumente
Denis Lutz
03/09/13
Agenda
Rake for Developers The Hyphothesis about Ant Hello World from Rake Ant Hypothesis proove 1 Rake for Project Managers Ant Hypothesis proove 2 Case Study The Perfect Build Riskmanagement 3 Improvements you can make with rake
Ant
build management deployments initial project setup / configurations product data load
03/09/13
Ant
Hypothesis
1. Ant is not sufficient for what we want to do
Solution: RAKE!
03/09/13
Rake
03/09/13
What is rake?
03/09/13
What is rake? Calling a core ant task rake is a plain mapping to the ant java classes !
What is rake?
Create a task that is dependent on the unzip task It should create a folder and move the unzipped file into it
03/09/13
Back to Hypothesis
03/09/13
build management deployments initial project setup data load (csv, fixtures) cron job execution moving / copying / deleting files or directories
03/09/13
10
Ant: Looks pretty simple right? Just couple lines, markup was always easy Rake: I want to do operations as would it be in a unix environment, and rake realizes it:
03/09/13
11
Ant is not sufficient for what we want to do processing a data set (Array) in a loop
Ant: See, for anything that a normal language has, ant has a markup version of it Ant: So you will be always fine and be able to write what you want Rake: Well lets just take a scripting language then like ruby Rake: and by the way, can you use unique ant syntax somewhere else ouside the build scripts?
03/09/13
12
Ant: Yea, conditions are definded on the tasks themselves, since its all about tasks.
03/09/13
13
03/09/13
14
Rake: How about some methods to dont repeat yourself in the build? Ant: Methods??? Your kidding me right? Targets are your methods, or create a macrodef
Ant: If it gets too complicated soo create your java class and call it from ant
Rake:
Dude, I just want a method ok?
So attribute is clear thats what I need Whats the deal with the <element /> ? What is the <sequential/> suppose to mean? So I predefine what tasks I will call inside my new macro ? Should I always use sequential ?
03/09/13
15
03/09/13
16
Rake: I want to create some objects in my script Ant: Objects??? Lets not exagerrate here ok? Ant: If its that complicated just create a custom ant task with a java class
Rake: Yea, its like object orientation = elegance , so we should use it directly in the script
03/09/13
17
Ant: LOL, it should not be that complicated Ant: unless you really want to fly to the moon Rake: Well lets say I have a deployment script and I deal with servers Rake: This is what I could do with object orientation, all this in one file, within mins
03/09/13
18
03/09/13
19
03/09/13
20
2. We dont use Ant often enough to learn it properly We have proper ant experience only at the project setup its mostly done by one dedicated person everyone else is not familiar with ant and the build script
developers tend to do fast adjustments to the script using the ant api
you are good with ant if you worked with it for a longer time the ant knowledge can not be used somewhere else
03/09/13
21
rake is a subset of ruby => ruby syntax jruby can be declared as the core scripting language in each (java) project anyways because we need ruby for: data import, front end, parsing, any scripting language tasks the knowledge of rake ( = ruby ) is a good investment for developers ruby is a great, simple, elegant and powerfull language
developers can do with ruby knowledge much more then with same amount of ant knowledge
03/09/13
22
But java has its scripting languages.. Why dont we use groovy, beanshell, jsr?
ruby has a bigger community then the java scripting languages (proofes on next slides) ruby knowledge is reused much more in projects with ruby if declared as scripting language
03/09/13
23
03/09/13
24
Rails competes with JSF in the meanwhile, which indirectly shows the power and acceptance of the ruby language on the us market.
03/09/13
25
1. Setting up the project initially and for any new team member
03/09/13
26
1. Setting up the project initially and for any new team member
setting up the system always a time consuming task knowledge is mostly party written on the wiki and outdated no one really knows what the project setup steps are the older the project the more out of sync is it the project setup takes usually the time of the new person and one team member
At the end you loose a lot of time, instead of initially investing little bit more!
03/09/13
27
03/09/13
28
How can we fix it? = What can be automated? = Run in one workflow? Git/SVN Checkout Local database setup (setting up mysql/oracle + create database) Unzipping of vendor files (commercial integrated systems, solr, patches)
03/09/13
29
1. The project itself should know about its setup, not the wiki, it will be outdated and lost 2. The only one thing that the user should do is the database installation and checkout 3. Even in the manual steps, the user should be guided by the rake script
03/09/13
30
03/09/13
31
Demo / Case Study The perfect Project Setup, what did we do? :
SVN Checkout --> manually Local database setup (setting up mysql/oracle + create database) (still potentially automatable) Unzipping of vendor files (solr, patches) DONE Cofiguration files setup: user setting + default + environment DONE Build (starting automatically) DONE Database initialization (without entering the webclient) DONE different data imports (* n times) DONE
03/09/13
32
03/09/13
33
Demo / Case Study The perfect Project Setup, why was that much more time and money saving? did the user need any project specific knowledge yet? No did he need to ask someone for something? No did he need to look up a wiki page and wait till his account on it is created? No even if there was a manual step we were exactly telling the user what to do at the right time
our assumtion for now was: he works on a mac / unix system he had to be able to install mysql database by himself he should have been able to check out the project
03/09/13
34
Why the rake integration has no risks for any java environment?
jruby rake runs on the java virtual machine and calls the old ant tasks we have the old ant build.xml still inside the project we can go back to ant all the time, just by adding old ant targets jruby is used anyways if this is the official project scripting language so we are not introducing something new to our standard setup
03/09/13
35
each developer should get familiar with the build the build is your source for any automation server starts (back end/ sorl/ front end/ any server) cronjob execution (instead of looking it up in a client and executing) repetitive data load (you work on a data load and need repetitive execution) any new task that can be added, is easy to add with rake
03/09/13
36
3. Deployment management
granular understandable / maintable same advantages as for the project setup apply ivy integration
03/09/13
37
Conslusion
Conclusion/Suggestions
ant => has weak points, was ok a long time, but its time to move on
rake => great new option to use, has a lot of synergies and is fun separate discussion needed for deployments strategy based on rake start saving money and time today start having smooth builds today
03/09/13
38
Thanks
Thanks
Questions?
03/09/13
39