0% found this document useful (0 votes)
6 views31 pages

Tek 2010 Coderelease

The document discusses code and release management. It covers version control options like SVN, branching methodologies like feature branches and release branches, and pushing code live through methods like SVN checkout or export and rsync. Managing code releases involves version control, branching, testing, and deployment.

Uploaded by

Ramakrishna K
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
6 views31 pages

Tek 2010 Coderelease

The document discusses code and release management. It covers version control options like SVN, branching methodologies like feature branches and release branches, and pushing code live through methods like SVN checkout or export and rsync. Managing code releases involves version control, branching, testing, and deployment.

Uploaded by

Ramakrishna K
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 31

Code & Release Management

By: Eli White (HiiDef Inc / Goodsie.com)

Tuesday, May 18, 2010


Welcome!

Who the heck is this guy?

2 Code & Release Management - Eli White - Tek X - May 19th, 2010
Tuesday, May 18, 2010
Welcome!

Who the heck is this guy?

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

•Projects are subdirectories of a repository:


//host/project

•The mainline (trunk) of code:


//host/project/trunk

•Branches & Tags have parallel directories:


//host/project/branches/v3.0
//host/project/tags/v3.0.1

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

•Branches exist for each stage of a project:


 staging, production, etc.

•When ready for a release, merge into staging

•After testing, merge into production

•Tag against production branch for releases

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

•When ready for release, create a versional branch:


/branches/v3.0

•Test against the branch

•Tag the branch with a versional tag for release:


/tags/v3.0.0

•Fix bugs against branch, and tag as needed

•Continue doing new work against 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

•Handle multiple machines

•Use for all phases staging/testing

•Have a rollback procedure

•Multiple ways to accomplish

•Incorporate everything together:


Services, DB, PHP, etc

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

Have a working SVN checkout on the live servers,


just perform SVN update or switch

 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

Use SVN Export to make a copy of the code,


then use rsync to transfer changed files to live.

 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

•You might have web traffic while codebase is partially updated

•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?

For this presentation & more:


http://eliw.com/

Twitter: @eliw

HiiDef: http://hiidef.com/
Goodsie: http://goodsie.com/

Rate Me: http://joind.in/1579

30 Code & Release Management - Eli White - Tek X - May 19th, 2010
Tuesday, May 18, 2010

You might also like