continuous integration with jenkins
TRANSCRIPT
Continuous Integration
with Jenkins
中華電信研究院 黃培棠
2013/03/14
2
3
Just one click!
4 TOP 10 BEST GODZILLA FILMS by Calum Waddell, http://www.scifinow.co.uk/top-tens/29950/top-10-best-godzilla-films/
5
Fail Early,
Fail Fast,
Fail Often.
Continuous Integration
It is the practice of merging
all developer workspaces
with a shared mainline
several times a day.
6 http://en.wikipedia.org/wiki/Continuous_integration
Continuous What?
• Build
• Test – Unit tests, integration tests…
• Analysis
• Feedback
• Publish
• Deploy
• ... most tedious things!
7
What To Be Integrated?
• People
• Code
• Environment
• Report
• Thought
• ... everything valuable!
8
9 Why Developers <3 CI: A Guide to Loving Continuous Integration by Rebel Labs
http://zeroturnaround.com/rebellabs/why-developers-love-ci/
OR NOTIFY?
10 Jez Humble, David Farley, Continuous Delivery: Reliable Software Releases through Build, Test, and Deployment Automation,
2010, Addison-Wesly
11 Jez Humble, David Farley, Continuous Delivery: Reliable Software Releases through Build, Test, and Deployment Automation,
2010, Addison-Wesly
Ticket for CI
• SCM system
• Build scripts/tools
• Automated test cases
• Artifact repository
• Fast, highly available machines
• Open-minded members
12
Power Tools
13 Why Developers <3 CI: A Guide to Loving Continuous Integration by Rebel Labs
http://zeroturnaround.com/rebellabs/why-developers-love-ci/
CI Servers Build Automation Tools Artifact Repositories Test Frameworks Code Analysis
14 Paul M. Duvall et al, Continuous Integration: Improving Software Quality and Reducing Risk, 2007, Addison-Wesley
Jenkins
Introducing to Butler with Bowtie:
15
Personal Information
• Child of Kohsuke Kawaguchi (川口耕介)
• Renamed from Hudson
– Had cosmetic surgery at the same time
16 portrait before the surgery
Skills
• 耐操、有擋頭
– 不遲到、不早退
– 不會亂吠
• 專心
– 不會上 facebook, YouTube
• 記性好
– 不會忘了改什麼設定,或忘了按 commit 就下班
• 便宜
17
Running Jenkins
• Download
– http://mirrors.jenkins-ci.org/war-stable/latest/jenkins.war
• Run
• Play around
– http://localhost:8080/
18
java -jar jenkins.war [--httpPort=8080]
https://wiki.jenkins-ci.org/display/JENKINS/Starting+and+Accessing+Jenkins
19
Built-in Plugins
20
Work Behind Proxy
21 Is it really a part of Update Center?
Thanks Maven POM
22
Just Tell Him What to Build
23
CI Practices
• Everyone commits at least once a day.
• Keep the build fast.
– An unit test is just an UNIT test.
– Replace dependencies with mocks.
• 100% of tests must pass for every build.
• Fixing broken builds is of the highest priority.
• Someone review reports generated by the build.
24 http://www.martinfowler.com/articles/continuousIntegration.html & Paul M. Duvall et al, Continuous Integration
25
Action!
Jenkins++
26
s/green/blue/g
• It's not for color blind users.
• It's all about (influenced by ):
• Green Balls Plugin – https://wiki.jenkins-ci.org/display/JENKINS/Green+Balls
27
青 Cyan #00FFFF http://jenkins-ci.org/content/why-does-jenkins-have-blue-balls
• Gravatar - Globally Recognized Avatar
• Register your own avatar
– at https://en.gravatar.com/
• Easy identification easy
28
Static Code Analyses
29
• Checkstyle
• DRY
• FindBugs
• PMD
• Compiler Warnings
• Task Scanner
– TODO, FIXME, XXX...
Disk Usage
• Keep watching!
30
CI Game
31
• Go top!
Build Pipeline
32
Extreme Feedback
33 Continuous Integration using Jenkins by Chris Shenton, http://koansys.com/tech/jenkins/jenkins-ci-pdf/view