jenkins ci

63
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 。

Upload: haochenglee

Post on 15-Jan-2015

19.892 views

Category:

Technology


0 download

DESCRIPTION

Introduction to Jenkins (Hudson) Continuous Integration Server

TRANSCRIPT

Page 1: Jenkins CI

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 。

Page 2: Jenkins CI

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

Page 3: Jenkins CI

Why CI?

Rapid Feedback

Reduced Risk

Collective Ownership

Continuous Deployment

Offload from people

Page 4: Jenkins CI

Best Practices of CI

Single Source Repository

Commit often

Make Your Build Self-Testing

Automate the Build

Build fast

Page 5: Jenkins CI

Jenkins

Extensible continuous integration server

Page 6: Jenkins CI

What is Jenkins?

Open-source CI server

Easy to install and use

ExtensibilityOver 330+ plugins (230+ last year)More than 20,000 installations

Page 7: Jenkins CI

Why Jenkins?

GUI to manage

Strong community and eco-system

Distributed builds

Open Source and Free!

Page 8: Jenkins CI

from Koshuke's slide: Continuous Integration in the Cloud with Hudson, JavaOne 2009

Lots of people are using Jenkins...

Page 9: Jenkins CI

Including Yahoo ;-)

Page 10: Jenkins CI

CI Tools survey in 2009

http://www.wakaleo.com/resources/polls

Page 11: Jenkins CI

CI Tools survey in 2010

http://www.wakaleo.com/resources/polls

Page 12: Jenkins CI

Another CI Tools Survey in 2010

Page 13: Jenkins CI

Jenkins is still growing...

Page 14: Jenkins CI

And the Job Trend is increasing

Page 15: Jenkins CI

Basic Features

Notice a change

Check out source code

Execute builds/tests

Record and publish results

Notify developers

Page 16: Jenkins CI

CI Overview

from Continuous integration with Hudson

Page 17: Jenkins CI

Notice a change

Build Periodically

Depend on other projects

Poll SCMSubversion Push vs. Pull

Page 18: Jenkins CI

Check out source code

Subversion

CVS

Git

Mercurial

Perforce

Page 19: Jenkins CI

Execute builds/tests

JavaAnt, Maven, Gradle

.NetMSBuild, PowerShell

Shell ScriptPython, Ruby, Groovy

Page 20: Jenkins CI

Record and publish results

JUnitTestNGFindbugsCoberturaCheckstylePMD

Page 21: Jenkins CI

Job Status

Job State: Job Stability:

Page 22: Jenkins CI

Findbugs Integration

Page 23: Jenkins CI

Cobertura Integration

Page 24: Jenkins CI

Project Relationship

Page 26: Jenkins CI
Page 27: Jenkins CI

Twitter

Page 28: Jenkins CI

Jenkins on Eclipse

Update Site: http://code.google.com/p/hudson-eclipse/

Page 29: Jenkins CI

Jenkins on Android

Android MarketJenkins Wiki

Page 30: Jenkins CI

eXtreme Feedback Panel plugin

Page 31: Jenkins CI

Jenkins Sound pluginhttp://wiki.jenkins-ci.org/display/JENKINS/Jenkins+Sounds+plugin

Page 32: Jenkins CI

DEMO

Page 33: Jenkins CI

Installation&Upgrade

Download Tomcat 6

Download jenkins.war

Put jenkins.war under webapps

Start Tomcat

Page 34: Jenkins CI

Create a Job

Page 35: Jenkins CI

Configure a Job

Page 36: Jenkins CI

Configure Jenkins

Page 37: Jenkins CI

Manage Plugins

Page 38: Jenkins CI

Going Distributed

Need Isolation

Need Different environments

One Computer is not enough

Page 39: Jenkins CI

Add Slave using JNLP

Java Web Start on slave initiates the sessionJenkins sends JNLP file and jar filesA separate socket connection is made

Page 40: Jenkins CI

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

Page 41: Jenkins CI

Some Distributed Issues

Different OS/Environment

Install required tools

System administration

Need to install slave manually

Tied Jobs to Slaves

Page 42: Jenkins CI

Monitor Slaves

Monitor key metricsLow disck space and swapClock out of sync

Put offline automatically

Page 43: Jenkins CI

from Koshuke's slide: Continuous Integration in the Cloud with Hudson, JavaOne 2009

Page 44: Jenkins CI

from Koshuke's slide: Continuous Integration in the Cloud with Hudson, JavaOne 2009

Page 45: Jenkins CI

Labels to Rescue

Page 46: Jenkins CI

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

Page 47: Jenkins CI

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

Page 48: Jenkins CI

Create Matrix Project

Page 49: Jenkins CI

Configuration

Page 50: Jenkins CI

Results

Page 51: Jenkins CI

DEMO

Page 52: Jenkins CI

Jenkins on Cloud

Jenkins EC2 plugin

CloudBees

8.5 cents/hour of EC2 vs 1 cent/minute of CB

Page 53: Jenkins CI

Jenkins EC2 plugin

AWS Account Information

Page 54: Jenkins CI

Jenkins EC2 plugin

And which AMI you want to start

Page 55: Jenkins CI

CloudBees' Jenkins as a Service

Page 56: Jenkins CI

Miscellaneous

Integrate with Repository Browser

Monitor an external job

Jenkins for non-Java Projects

Page 57: Jenkins CI

Tracking Changes

Page 58: Jenkins CI

Integration with Sventon

Page 59: Jenkins CI

Monitor an External Job

Hudson Wiki - Monitor an External Job

Page 61: Jenkins CI
Page 63: Jenkins CI

[email protected] @haocheng on Twitter