Tek 2010 Coderelease
Tek 2010 Coderelease
2 Code & Release Management - Eli White - Tek X - May 19th, 2010
Tuesday, May 18, 2010
Welcome!
2 Code & Release Management - Eli White - Tek X - May 19th, 2010
Tuesday, May 18, 2010
What are we talking about?
Managing the daily workflow, from editing to testing & releasing
3 Code & Release Management - Eli White - Tek X - May 19th, 2010
Tuesday, May 18, 2010
Version Control
•Use it!
It is the core component of this process.
•Many variations
All have same core concepts:
•Checkout, Committing, Merging, Concurrency
4 Code & Release Management - Eli White - Tek X - May 19th, 2010
Tuesday, May 18, 2010
Version Control Options
CVS
5 Code & Release Management - Eli White - Tek X - May 19th, 2010
Tuesday, May 18, 2010
Version Control Options
6 Code & Release Management - Eli White - Tek X - May 19th, 2010
Tuesday, May 18, 2010
Version Control Terminology
Commit / Check-in
Changes to the code base are added to the repository
Branch
Making a copy of the code to be managed in parallel
Tag
Marking a snapshot in time of a set of files
Trunk
The main line of development, before branching
Merge
Combining two sets of changes into one
7 Code & Release Management - Eli White - Tek X - May 19th, 2010
Tuesday, May 18, 2010
Subversion (SVN) 101
•Subversion thinks in terms of a directory structure
8 Code & Release Management - Eli White - Tek X - May 19th, 2010
Tuesday, May 18, 2010
Version Control Policies
•Come up with general rules that you apply:
Intermediate (non-working) checkins?
Where should you check code in?
Are there places that are less controlled?
How does this flow into releases?
What about tags vs branches vs trunk?
9 Code & Release Management - Eli White - Tek X - May 19th, 2010
Tuesday, May 18, 2010
Uses of Tags/Branches/Trunk
•No matter what style of management:
•Trunk:
Contains the 'core' codebase
•Branches:
Used to 'segment' into logical areas of responsibility
•Tags:
Marking a specific state of code, a release
10 Code & Release Management - Eli White - Tek X - May 19th, 2010
Tuesday, May 18, 2010
Different Branch Methodologies
How to organize your releases
11 Code & Release Management - Eli White - Tek X - May 19th, 2010
Tuesday, May 18, 2010
Explore Three Styles
h e s
ra nc
ge B e s
St a a n ch
e Br
a t u r
Fe
Bra n c h e s
Re le a se
12 Code & Release Management - Eli White - Tek X - May 19th, 2010
Tuesday, May 18, 2010
Stage Branches
•All new work done against Trunk
13 Code & Release Management - Eli White - Tek X - May 19th, 2010
Tuesday, May 18, 2010
Stage Branches
14 Code & Release Management - Eli White - Tek X - May 19th, 2010
Tuesday, May 18, 2010
Stage Branches
Pros: Cons:
Simple No parallel work
No dynamic branches No old patches
No room for errors
Long scale work hard
Error prone merging
15 Code & Release Management - Eli White - Tek X - May 19th, 2010
Tuesday, May 18, 2010
Feature Branches
•All new work done in it's own branch
•When complete, the new feature is tested
•Once ready, it's merged to trunk
•Trunk is tagged as needed for phases:
For testing/QA, Releasing, etc
16 Code & Release Management - Eli White - Tek X - May 19th, 2010
Tuesday, May 18, 2010
Feature Branches
17 Code & Release Management - Eli White - Tek X - May 19th, 2010
Tuesday, May 18, 2010
Feature Branches
Pros: Cons:
Parallel work easy Often creating branches
Long scale work easy Lots of merging
No old patches
Fixes are complicated
18 Code & Release Management - Eli White - Tek X - May 19th, 2010
Tuesday, May 18, 2010
Release Branches
•All new work done on trunk
19 Code & Release Management - Eli White - Tek X - May 19th, 2010
Tuesday, May 18, 2010
Release Branches
20 Code & Release Management - Eli White - Tek X - May 19th, 2010
Tuesday, May 18, 2010
Release Branches
Pros: Cons:
Easy maintenance Branch/Tag creation
Long scale work OK Assumes single goal
Some parallel work
Little merging
21 Code & Release Management - Eli White - Tek X - May 19th, 2010
Tuesday, May 18, 2010
Mix and Match
You go
t featu
re bran
ches in m y r
elease
bran ch!
22 Code & Release Management - Eli White - Tek X - May 19th, 2010
Tuesday, May 18, 2010
Pushing Code Live
You’ve managed the development, but now take it live!
23 Code & Release Management - Eli White - Tek X - May 19th, 2010
Tuesday, May 18, 2010
Pushing Code Live
•Have a script
24 Code & Release Management - Eli White - Tek X - May 19th, 2010
Tuesday, May 18, 2010
So Many Options
Discuss a couple of common ones:
k ou t
N C hec
ve SV
L i
SVN E
xport
& rsy
nc
25 Code & Release Management - Eli White - Tek X - May 19th, 2010
Tuesday, May 18, 2010
Live SVN Checkout
Simple
Some benefits of having live copy
Drawbacks:
• Conflicts, Hard to automate & rollback
26 Code & Release Management - Eli White - Tek X - May 19th, 2010
Tuesday, May 18, 2010
SVN Export & rsync
Simple
Easy to scale & automate
27 Code & Release Management - Eli White - Tek X - May 19th, 2010
Tuesday, May 18, 2010
Problems with partial Updates with rsync
•rsync is not atomic
•Solutions?
Take website offline
Use symlinks
28 Code & Release Management - Eli White - Tek X - May 19th, 2010
Tuesday, May 18, 2010
Rollbacks with rsync
•You will need to rollback, expect it!
•Solutions?
rsync again
Use symlinks
29 Code & Release Management - Eli White - Tek X - May 19th, 2010
Tuesday, May 18, 2010
Questions?
Twitter: @eliw
HiiDef: http://hiidef.com/
Goodsie: http://goodsie.com/
30 Code & Release Management - Eli White - Tek X - May 19th, 2010
Tuesday, May 18, 2010