supermondays: jenkins ci lightning talk

20
Jenkins Continuous Integration A quick overview of Jenkins CI Michael Peacock @michaelpeacock michaelpeacock.co.uk

Upload: michael-peacock

Post on 11-May-2015

1.851 views

Category:

Technology


4 download

DESCRIPTION

A brief introduction to Jenkins Continuous Integration Tool; a 5 minute lightning talk for the SuperMondays community.

TRANSCRIPT

Page 1: Supermondays: Jenkins CI lightning talk

Jenkins Continuous IntegrationA quick overview of Jenkins CI

Michael [email protected]

Page 2: Supermondays: Jenkins CI lightning talk

Continuous What?• Automated build and test process to verify a

software / website / web app build• Quality Assurance applied continually during

development

continuous integration (CI) implements continuous processes of applying quality control — small pieces of effort, applied

frequently. Continuous integration aims to improve the quality of software, and to reduce the time taken to deliver it, by replacing

the traditional practice of applying quality control after completing all development.*

* http://en.wikipedia.org/wiki/Continuous_integration

Page 3: Supermondays: Jenkins CI lightning talk

Jenkins!

Page 4: Supermondays: Jenkins CI lightning talk

Jenkins...

• Built with Java• Provides its own web based interface –

doesn’t interfere with your Apache installation• Recommendation: install Continuous

Integration stuff on a separate server – processing lots of builds could get resource intensive

• Available for Windows, Mac and Linux

Page 5: Supermondays: Jenkins CI lightning talk

Installation• Add the Jenkins repository key to aptitudewget -q -O - http://pkg.jenkins-ci.org/debian/jenkins-ci.org.key | sudo apt-key add –

• Add the repository to your sources filesudo nano /etc/apt/sources.listdeb http://pkg.jenkins-ci.org/debian binary/sudo apt-get update

• Installsudo apt-get install jenkins

Page 6: Supermondays: Jenkins CI lightning talk

Modular

Page 7: Supermondays: Jenkins CI lightning talk

Works with version control systems• SVN• Git• Mercurial• CVS

Page 8: Supermondays: Jenkins CI lightning talk

Ant

• Should be familiar to Java programmers...• Makes it really easy to:

– Move, copy, delete, rename files and folders – use it to move files around after checking out from version control e.g. Swap in a test config file

– Run commands / programs on the code – such as unit testing, code sniffing and generating documentation

• Built in to Jenkins out of the box

Page 9: Supermondays: Jenkins CI lightning talk

Testing

• Automatically run your unit tests– Find a plugin– Get ant to run your tests by executing commands– Build fails if tests fail

<target name="phpunit" description="Run unit tests using PHPUnit and generates junit.xml and clover.xml"> <exec executable="phpunit" failonerror="true"/> </target> <target name="phpunit" description="Run unit tests using PHPUnit and generates junit.xml and clover.xml"> <exec executable="phpunit" failonerror="true"/> </target>

<target name="phpunit" description="Run unit tests using PHPUnit and generates results as XML files"> <exec executable="phpunit" failonerror="true"/> </target>

Page 10: Supermondays: Jenkins CI lightning talk
Page 11: Supermondays: Jenkins CI lightning talk

http://www.buildsonmymachine.com/

Page 12: Supermondays: Jenkins CI lightning talk

Weather Report

Page 13: Supermondays: Jenkins CI lightning talk
Page 14: Supermondays: Jenkins CI lightning talk

You broke the build

• Stigmatises breaking the build

• Helps “encourage” / bully developers into better quality work

Page 15: Supermondays: Jenkins CI lightning talk

http://www.youbrokethebuild.com/

Page 16: Supermondays: Jenkins CI lightning talk

Record keeping

What changed in the build?

Page 17: Supermondays: Jenkins CI lightning talk

Pipeline

Chain Jenkins jobs together, triggering others (e.g. deployment) only when the first job builds successfully, ensures only tested and quality code goes online

• https://wiki.jenkins-ci.org/display/JENKINS/Build+Pipeline+Plugin

• (no screenshots, because I couldn’t get it to work )

Page 18: Supermondays: Jenkins CI lightning talk

Deployment

• Plug Jenkins into your deployment process• Copy files over FTP• Copy files over SSH• Execute commands on a remote server

– Tell the web server that the new site has been copied across and is ready for use

Page 19: Supermondays: Jenkins CI lightning talk

Improve

• Improve the quality of your code• Automate your:

– Testing– Quality Assurance process– Deployment to development areas– Deployment to live environment (through

pipeline)• Keep clients happier!

Page 20: Supermondays: Jenkins CI lightning talk

Any questions?

• http://jenkins-ci.org/• http://bit.ly/jenkinsciphp

Michael [email protected]