Documente Academic
Documente Profesional
Documente Cultură
Continuous Deployment
with Gerrit and Jenkins
R. Tyler Croy
Lookout, Inc.
http://mylookout.com/about/j
obs
I work here
10/2/11
10/2/11
10/2/11
Meet Gerrit
Pro-tips/best practices
Continuous Deployment
What it isn't
10/2/11
10
What it is
Meet Gerrit
10/2/11
16
10/2/11
17
10/2/11
18
Change 123
Patchset 1
Commit cdeb34
Patchset 2
Commit 41dbe5
Change 123
Patchset 1
Commit cdeb34
Patchset 2
Commit 41dbe5
10/2/11
28
Developer Workflow
gerrit
dev-b
dev-a
upstream
Flow of changes
Create
Local
Branch
work
Push
to
Gerrit
Flow of changes
Create
Local
Branch
work
Push
to
Gerrit
Flow of changes
Create
Local
Branch
work
Fix
commit
rejected
rebased!
Push
to
Gerrit
Review
approved/
submitted
Upstream repo
Flow of changes
Create
Local
Branch
work
Fix
commit
rejected
rebased!
Push
to
Gerrit
Review
approved/
submitted
Upstream repo
REBASE IS SCARY
(but necessary)
How it works
upstream/master
A
local-topic-branch
A
How it works
upstream/master
A
local-topic-branch
A
How it works
upstream/master
A
local-topic-branch
A
D
Change-Id: Icde43
E
Change-Id: I51bdc2
How it works
upstream/master
A
local-topic-branch
A
DE
Change-Id: Icde43
How it works
upstream/master
A
local-topic-branch
A
DE
Change-Id: Icde43
gerrit
Commands sent
over SSH
Streamed events
over SSH
10/2/11
Jenkins
45
10/2/11
46
A simple pipeline
Flow of changes
Create
Local
Branch
work
Fix
commit
Build Fails!
(-1, Not Verified)
Verification
Job
Success!
(+1, Verified)
Push
to
Gerrit
Review
Upstream repo
Flow of changes
Create
Local
Branch
work
Fix
commit
Build Fails!
(-1, Not Verified)
Verification
Job
Success!
(+1, Verified)
Push
to
Gerrit
Review
Upstream repo
Deployment
gerrit
upstream
Release
Build
dev-b
dev-a
Release
Test
Release
Deploy
Deployment
upstream
Release
Build
Downstream Job
Release
Test
Downstream Job
Release
Deploy
Production machines
rsync/
cap/
scp/
mvn
Deployment
upstream
Release
Build
Downstream Job
Release
Test
Downstream Job
Release
Deploy
Production machines
rsync/
cap/
scp/
mvn
Multiple Branches
Developer 1
A
C1
Developer 2
A
C1
Developer 1
A
C2
Developer 2
A
C1
Upstream
A
C2
Developer 2
A
C1
~ $ git rebase
gerrit/master
First, rewinding head to
replay your work on top of
it...
Applying: Unused variable
Using index info to
reconstruct a base tree...
Upstream
A
C2
Developer 2
A
C2
Developer 1
A
C1
Developer 2
A
C1
Developer 1
A
C1
Developer 2
A
C2
10/2/11
75
10/2/11
76
10/2/11
77
Pro Tips
10/2/11
84
Final Thoughts
Final Thoughts
Final Thoughts
Final Thoughts
Final Thoughts
Gerrit: http://code.google.com/p/gerrit
Gerrit Trigger Plugin:
http://urlenco.de/oyhmac
These slides (w/ notes):
http://urlenco.de/vhqjl
10/2/11
94