Continuous integration

Post on 10-May-2015

386 views 1 download

Tags:

description

This was my talk from November Camp 2013

Transcript of Continuous integration

Tobias Nyholm

Continuous Integration

Tobias Nyholm

Tobias Nyholm

About me

• Doing Symfony since 1.2!

• Master thesis at KTH!

• Happy Recruiting We sort your pile of resumés

���2

Tobias Nyholm

Every software project

���3

Tobias Nyholm

What is efficiency?

• Resource efficiency !

• Every developer works full time!

• You develop all day without distractions like Facebook or coffee breaks

���4

Tobias Nyholm

What is efficiency?

• Flow efficiency!

• Developer A completes X in 4 h!

• Developer B completes the same task X in 3 h!

• Developer B is more efficient than A

���5

Tobias Nyholm

What is quality?

���6

• Reliability !

• Performance Efficiency!

• Security!

• Maintainability!

• Size of the project

Ref: CISQ's Quality model

Tobias Nyholm

Extreme Programming - Definition

• Pair programming!

• Plan sprints!

• Test Driven Development!

• Communication with the customer!

• Continuous Integration!

• Refactoring!

• Small releases!

• Coding standards!

• Collective code ownership!

• Simple design!

• System metaphor!

• Sustainable pace!

• No overtime!

• Leave optimization until last!

• 100% test coverage!

• Write test for all bugs

���7

Ref: http://en.wikipedia.org/wiki/Extreme_programming

Tobias Nyholm

Extreme Programming

• KISS and DRY!

• Test Driven Developmet!

• Trust your test code!

• Share knowledge between developers!

• Be happy and healthy

���8

Tobias Nyholm

Overview

���9

Tobias Nyholm

Story Cards

���11

Tobias Nyholm

Overview - Development

���12

Tobias Nyholm

Overview - Revision control

���13

Tobias Nyholm

Branching

���14

Tobias Nyholm

Git vs SVN

���15

Tobias Nyholm

Overview - Jenkins

���17

Tobias Nyholm

Jenkins is the heart of CI

���18

Tobias Nyholm

Important stuff

���19

• Quick feedback!

• SVN/GIT - hook!

• Only CM should have permissions to change the rules in Jenkins

Tobias Nyholm

Overview - Build servers

���20

Tobias Nyholm

Build fast

���21

• Build SNAPSHOTS from master!

• Short build queues (< 10 min)!

• Multiple build servers!

• Parallel builds

Tobias Nyholm

Overview - Test

���22

Tobias Nyholm

Overview - Analysis

���23

Tobias Nyholm

Sonar

���24

• A platform for code analysis!

• Make you own quality profile!

• Create alarms when the profile is violated!

• Break the build when an alarm triggered

Tobias Nyholm

Sonar - Rules

���25

• Plugins like PHPMD, PHP Depend, PHP_CodeSniffer etc!

• Complexity!

• Comments!

• Size of the source code!

• Performance

Tobias Nyholm

Sonar - Benefits

���26

• Change history!

• Unified code that is easy to maintain!

• Reduce complexity!

• More documented code

Quality - Definition ✓Reliability ✓Performance Security ✓Maintainability ✓Size of the project

Tobias Nyholm

Upload to artefact repository

���27

Tobias Nyholm

Overview - Deployment

���28

Tobias Nyholm

Puppet is king

���29

Tobias Nyholm

Capistrano, Ant, Octopus

• Check out code!

• Migrate the database!

• Empty cache, warm up cache!

• Run scripts!

• etc

���30

Tobias Nyholm

Distribution

• Distribute file automatically att each build!

• No developer should manually update any server!

• No human errors

���31

Tobias Nyholm

Environments

���32

• Local environment of every developers machine!

• Staging environment where Jenkins moves files automatically!

• QA environment where you move files when needed!

• Production environment!

• Make sure that the customer or project manager provide you with these

Tobias Nyholm

On HappyRecruiting

���33

Tobias Nyholm

Overview - Verification

���34

Tobias Nyholm

Summary

���35

Tobias Nyholm

Thank you

���36

Tobias Nyholm2013-11-22