Jenkins CI
haocheng
本著作係依據創用 CC Attribution-ShareAlike 3.0 Unported 授權條款進行授權。如欲瀏覽本授權條款之副本,請造訪 http://creativecommons.org/licenses/by-sa/3.0/ ,或寄信至 Creative Commons, 171 Second
Street, Suite 300, San Francisco, California, 94105, USA 。
Continuous Integration is a software development practice where members of a team integrate their work frequently, usually each person integrates at least daily – leading to multiple integrations per day. -- Martin Fowler
Why CI?
Rapid Feedback
Reduced Risk
Collective Ownership
Continuous Deployment
Offload from people
Best Practices of CI
Single Source Repository
Commit often
Make Your Build Self-Testing
Automate the Build
Build fast
Jenkins
Extensible continuous integration server
What is Jenkins?
Open-source CI server
Easy to install and use
ExtensibilityOver 330+ plugins (230+ last year)More than 20,000 installations
Why Jenkins?
GUI to manage
Strong community and eco-system
Distributed builds
Open Source and Free!
from Koshuke's slide: Continuous Integration in the Cloud with Hudson, JavaOne 2009
Lots of people are using Jenkins...
Including Yahoo ;-)
CI Tools survey in 2009
http://www.wakaleo.com/resources/polls
CI Tools survey in 2010
http://www.wakaleo.com/resources/polls
Another CI Tools Survey in 2010
Jenkins is still growing...
And the Job Trend is increasing
Basic Features
Notice a change
Check out source code
Execute builds/tests
Record and publish results
Notify developers
CI Overview
from Continuous integration with Hudson
Notice a change
Build Periodically
Depend on other projects
Poll SCMSubversion Push vs. Pull
Check out source code
Subversion
CVS
Git
Mercurial
Perforce
Execute builds/tests
JavaAnt, Maven, Gradle
.NetMSBuild, PowerShell
Shell ScriptPython, Ruby, Groovy
Record and publish results
JUnitTestNGFindbugsCoberturaCheckstylePMD
Job Status
Job State: Job Stability:
Findbugs Integration
Cobertura Integration
Project Relationship
Notify developers
TwitteremailRSSIMIDE
Android/iPhoneFirefox
Jenkins on Eclipse
Update Site: http://code.google.com/p/hudson-eclipse/
Jenkins on Android
Android MarketJenkins Wiki
eXtreme Feedback Panel plugin
Jenkins Sound pluginhttp://wiki.jenkins-ci.org/display/JENKINS/Jenkins+Sounds+plugin
DEMO
Installation&Upgrade
Download Tomcat 6
Download jenkins.war
Put jenkins.war under webapps
Start Tomcat
Create a Job
Configure a Job
Configure Jenkins
Manage Plugins
Going Distributed
Need Isolation
Need Different environments
One Computer is not enough
Add Slave using JNLP
Java Web Start on slave initiates the sessionJenkins sends JNLP file and jar filesA separate socket connection is made
Add Slave using sshd
Master talks to sshd on a slaveSend slave.jar and “java -jar slave.jar”SSH session becomes bi-di byte stream
Some Distributed Issues
Different OS/Environment
Install required tools
System administration
Need to install slave manually
Tied Jobs to Slaves
Monitor Slaves
Monitor key metricsLow disck space and swapClock out of sync
Put offline automatically
from Koshuke's slide: Continuous Integration in the Cloud with Hudson, JavaOne 2009
from Koshuke's slide: Continuous Integration in the Cloud with Hudson, JavaOne 2009
Labels to Rescue
More on Label
Don't tied job to Slave, tied to Label
Label is a group of slaves
Support boolean expressions since 1.372windows&&IEFF||Chrome!windows
Can be used with Matrix Project
Matrix project
Need to run in multiple environmentsDifferent JDKDifferent OSDifferent Browser
Axis could be:SlaveUser defined
Combination Filter !(OS=="linux" && browser=="IE")
Touchstone buildsSanity check
Create Matrix Project
Configuration
Results
DEMO
Jenkins on Cloud
Jenkins EC2 plugin
CloudBees
8.5 cents/hour of EC2 vs 1 cent/minute of CB
Jenkins EC2 plugin
AWS Account Information
Jenkins EC2 plugin
And which AMI you want to start
CloudBees' Jenkins as a Service
Miscellaneous
Integrate with Repository Browser
Monitor an external job
Jenkins for non-Java Projects
Tracking Changes
Integration with Sventon
Monitor an External Job
Hudson Wiki - Monitor an External Job
Jenkins for non-Java Projects
Python
PHP
Ruby
.Net
Jenkins: http://jenkins-ci.org/Mailing List: http://groups.google.com/group/jenkinsci-users?lnk=srg Wiki: http://wiki.jenkins-ci.org/ Follow @jenkinsci on Twitter"TS-5301 Continuous Integration in the Cloud with Hudson" by KoshukeHudson Wiki - Distributed buildsLabel and Matrix Project EnhancementsContinous Integration by Martin FowlerContinuous Integration with Hudson - the bookContinuous Integration with Hudson on JavaWorld
[email protected] @haocheng on Twitter
Top Related