Continuous Deployment with Gerrit and Jenkins - PowerPoint PPT Presentation

1 / 94
About This Presentation
Title:

Continuous Deployment with Gerrit and Jenkins

Description:

Continuous Deployment with Gerrit and Jenkins R. Tyler Croy Lookout, Inc. http://mylookout.com/about/jobs * The first place people might enter into the pipeline is ... – PowerPoint PPT presentation

Number of Views:868
Avg rating:3.0/5.0
Slides: 95
Provided by: cloudbees
Category:

less

Transcript and Presenter's Notes

Title: Continuous Deployment with Gerrit and Jenkins


1
Continuous Deployment with Gerrit and Jenkins
  • R. Tyler Croy
  • Lookout, Inc.
  • http//mylookout.com/about/jobs

2
Who is this guy?
3
I work here
4
(No Transcript)
5
(No Transcript)
6
(No Transcript)
7
  • Brief overview of Continuous Deployment
  • Meet Gerrit
  • A Basic Commit-to-Deploy Pipeline
  • Multiple branches with Gerrit Jenkins
  • The Human Factor
  • Pro-tips/best practices

8
Continuous Deployment
9
What it isn't
10
(No Transcript)
11
What it is
12
Who is using it?
13
Why Code Review?
14
Why Code Review?
15
Meet Gerrit
16
(No Transcript)
17
As a code review tool
18
As a code review tool
19
As a Git repository server
  • git checkout -b change-4
  • Switched to a new branch 'change-4'
  • git fetch gerrit refs/changes/04/4/1
  • From gerritttyclock
  • branch refs/changes/04/4/1 -gt
    FETCH_HEAD
  • git cherry-pick FETCH_HEAD
  • Finished one cherry-pick.
  • change-4 1d4351c Greatly improve the stability
    of tty-clock
  • 1 files changed, 3 insertions(), 0 deletions(-)

20
As a collaboration tool
21
As a collaboration tool
22
As a collaboration tool
23
As a collaboration tool
24
Code Review Points
25
Code Review Points
26
Changes in Gerrit
27
Changes in Gerrit
28
(No Transcript)
29
Developer Workflow
30
The Gerrit Flow
gerrit
upstream
dev-a
dev-b
31
Flow of changes
Create Local Branch
git checkout -b topic-branch
work
Push to Gerrit
git push gerrit HEADrefs/for/master
32
Flow of changes
Create Local Branch
git checkout -b topic-branch
work
Push to Gerrit
git push gerrit HEADrefs/for/master
33
Flow of changes
Create Local Branch
Fix commit
work
rejected
rebased!
Review
Push to Gerrit
Upstream repo
approved/ submitted
34
Flow of changes
Create Local Branch
Fix commit
work
rejected
rebased!
Review
Push to Gerrit
Upstream repo
approved/ submitted
35
Your development workflow in commands
  • git checkout -b local-topic-branch
  • work work work
  • git rebase -i upstream/master fix up commits
  • git push gerrit HEADrefs/for/master
  • Create new commits based on reviews
  • git rebase -i upstream/master squash up
  • git push gerrit HEADrefs/for/master

36
REBASE IS SCARY (but necessary)
37
How it works
upstream/master
A
B
C
git rebase upstream/master
local-topic-branch
A
B
D
E
38
How it works
upstream/master
A
B
C
local-topic-branch
A
B
C
D
E
39
How it works
upstream/master
A
B
C
git rebase -i upstream/master
local-topic-branch
A
B
C
D
E
Change-Id Icde43
Change-Id I51bdc2
40
git rebase -i origin/master pick e59df21
Greatly improve the stability of tty-clock squash
6c1ffe1 Fix some whitespace detached HEAD
785692b Greatly improve the stability of
tty-clock 1 files changed, 2 insertions(), 0
deletions(-) Successfully rebased and updated
refs/heads/change-4.
41
How it works
upstream/master
A
B
C
local-topic-branch
A
B
C
DE
Change-Id Icde43
42
How it works
upstream/master
A
B
C
local-topic-branch
A
B
C
DE
Change-Id Icde43
43
Gerrit Trigger Plugin
44
Creating a role account
  • ssh gerrit gerrit create-account

45
Commands sent over SSH
Streamed events over SSH
46
(No Transcript)
47
A simple pipeline
48
Creating a Jenkins verifier job
49
Creating a Jenkins verifier job
50
Creating a Jenkins verifier job
51
Flow of changes
Create Local Branch
Build Fails! (-1, Not Verified)
Fix commit
work
Verification Job
Success! (1, Verified)
Review
Push to Gerrit
Upstream repo
52
Flow of changes
Create Local Branch
Build Fails! (-1, Not Verified)
Fix commit
work
Verification Job
Success! (1, Verified)
Review
Push to Gerrit
Upstream repo
53
Deployment
gerrit
upstream
Release Build
dev-a
dev-b
Release Test
Release Deploy
54
Deployment
upstream
Release Build
Downstream Job
Release Test
Downstream Job
Release Deploy
rsync/ cap/ scp/ mvn
55
Deployment
upstream
Release Build
Downstream Job
Release Test
Downstream Job
Release Deploy
rsync/ cap/ scp/ mvn
56
Multiple Branches
57
Creating the branches in Gerrit
58
Creating the branches in Gerrit
git push gerrit release-1.0
59
From the developer point of view
git checkout -b relfix track
upstream/release-1.0 work work work git
add/commit git push gerrit HEADrefs/for/relea
se-1.0
60
From the Jenkins point of view
61
From the Jenkins point of view
62
(No Transcript)
63
The Human Factor
64
Working with changes in review
65
Working with in-review changes
git checkout -b topic-with-17 git fetch
gerrit refs/changes/17/17/1 git cherry-pick
FETCH_HEAD work work commit work work
commit
66
Working with in-review changes
Developer 1
A
B
C1
Developer 2
A
B
C1
D
E
67
Working with in-review changes
Developer 1
A
B
C2
Developer 2
A
B
C1
D
E
68
Working with in-review changes
Upstream
A
B
B
C2
Developer 2
A
B
C1
D
E
69
Working with in-review changes
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... Falling back to
patching base and 3-way merge... Auto-merging
ttyclock.c CONFLICT (content) Merge conflict in
ttyclock.c Failed to merge in the changes. Patch
failed at 0001 Unused variable When you have
resolved this problem run "git rebase
--continue". If you would prefer to skip this
patch, instead run "git rebase --skip". To
restore the original branch and stop rebasing run
"git rebase --abort". git rebase --skip HEAD
is now at edff388 Unused variable Applying Local
change
70
Working with in-review changes
Upstream
A
B
C2
Developer 2
A
B
C2
D
E
71
Picking up changes
Developer 1
A
B
C1
Developer 2
A
B
C1
72
Picking up changes
Developer 1
A
B
C1
Developer 2
A
B
C2
73
Performing manual verification by QA
74
Manual verification
75
Kick-off deployments with the Promoted Builds
plugin
76
(No Transcript)
77
(No Transcript)
78
Pro Tips
79
Use squash or fixup to condense changes
80
Create per-topic/ticket local branches for
clearer isolation of work
81
Multiple jobs with the same trigger criteria
82
Investigate the EC2 plugin for burstable testing
capacity
83
Gotchas and Errata
84
(No Transcript)
85
Dependencies in Gerrit
86
Dependencies in Gerrit
87
Dependencies in Gerrit
88
Final Thoughts
89
Final Thoughts
90
Final Thoughts
91
Final Thoughts
92
Final Thoughts
93
Thank You To Our Sponsors
94
QA and Links
  • Gerrit http//code.google.com/p/gerrit
  • Gerrit Trigger Plugin http//urlenco.de/oyhmac
  • These slides (w/ notes) http//urlenco.de/vhqjl
Write a Comment
User Comments (0)
About PowerShow.com