introduction to continuous integration

42
Continuous Integration with Jenkins

Upload: somkiat-puisungnoen

Post on 15-Jan-2015

213 views

Category:

Documents


4 download

DESCRIPTION

Introduction to Continuous Integration

TRANSCRIPT

Page 1: Introduction to Continuous Integration

Continuous Integration with Jenkins

Page 2: Introduction to Continuous Integration

Goals

Push code

Push code

Review code

Build on push

Daily build

Test on push

Nightly regression

Performance testing

Page 3: Introduction to Continuous Integration

About Trainer

Page 4: Introduction to Continuous Integration

Introduce Yourself 2 minutes

Page 5: Introduction to Continuous Integration

What is your Continuous Integration ?

Page 6: Introduction to Continuous Integration

What is your CI system ?

No Build Server

Nightly Build

Automated Build with

Basic Automated Test

Use Metrics

More About Testing

Automated Acceptance

Testing

Continuous Deployment

Continuous Delivery

Page 7: Introduction to Continuous Integration
Page 8: Introduction to Continuous Integration

Stressful Releases

Page 9: Introduction to Continuous Integration
Page 10: Introduction to Continuous Integration

What is CI ?• Continuous Integration !!!

• Automated Everything

• Build as often as possible

• Build early and often

• e.g. On every commit/nightly build

Page 11: Introduction to Continuous Integration

What is CI ?• Not just technical

• Organization and culture

Page 12: Introduction to Continuous Integration

What is CI ?• Software development practice

• What people do, not about what tools

• Integrate frequently

• Fast feedback

Page 13: Introduction to Continuous Integration

Benefit of CI• Fewer error/Reduce risks

• Fast feedback

• Much less manual testing

• Regression test without additional effort

• Generate deployable software

• Great confidence in the product

Page 14: Introduction to Continuous Integration

อะไรที่ไม่ใ่ CI• Nightly build

• Developer branch

• Scheduling integration point

• Building via IDE

Page 15: Introduction to Continuous Integration
Page 16: Introduction to Continuous Integration

CI Practices1. Maintain a single source repository

2. Automate the build

3. Make your build self-test

4. Everyone commit to the mainline everyday

5. Every commit should build the mainline on integration machine

6. Keep the build fact

7. Test in a clone of the production environment

8. Make it easy for everyone to get the latest executable

9. Everyone can see what is happen

10.Automate deployment

Page 17: Introduction to Continuous Integration

Single Source Repository• Single point of truth

• Everyone’s code in the same place

• NOT a branch per developer

• Shared ownership

Page 18: Introduction to Continuous Integration

Automate Build• IDE is not automating !!

• Use build tool

• Compile, package and test

Page 19: Introduction to Continuous Integration

Self-testing Build• Direct from source to running build

• No manual copy

• No click

• No edit config file

Page 20: Introduction to Continuous Integration

Self-testing Build• Test with

• Unit tests

• Functional tests

• Performance tests

Page 21: Introduction to Continuous Integration

Self-testing Build• Responsible persons should be notified when

anything fails

• Test web in more browser

Page 22: Introduction to Continuous Integration

Commit More Often• At lease one per hour

• Need small unit of work

• To commit cleanly you need to update first

Page 23: Introduction to Continuous Integration

Every Commit Build• It’s all about fast feedback

• Small changes

• Less to merge or fix

Page 24: Introduction to Continuous Integration

Publish Latest Distributable• Make it easy to get final product

• Should only build once

• Configuration is separate

Page 25: Introduction to Continuous Integration

Test in Production Clone• Detect multi-thread, cluster, load balance issue

• Test system architecture

• Real database

Page 26: Introduction to Continuous Integration

Keep Build Fast• It’s all about feedback

• If thing break you find out about it, fresh in your mind

• Keep up with frequent commit

Page 27: Introduction to Continuous Integration

Everyone See What’s Happening

• Reduce time to fix

• No excuse to commit on broken build

• It’s not about blame, it about feedback

Page 28: Introduction to Continuous Integration

Automate Deployment• Reduce human error

• Verify can run on somewhere other than “My Machine”

• Test not only on code, but deployment process too

• Don’t tie up System Administrators with boring stuff

• Don’t tie up Developers waiting for feedback

Page 29: Introduction to Continuous Integration

Make CI Work• Can not done in isolation

• Pick the right tool for the right job

• It’s not silver bullet

Page 30: Introduction to Continuous Integration

Build Pipeline

Page 31: Introduction to Continuous Integration

Traditional CI Flow

Page 32: Introduction to Continuous Integration

Build Pipeline Flow

Page 33: Introduction to Continuous Integration

One Click Deploys• Require the Build pipelines

• Reduce deployment time and risk

• Make go live a non-event

Page 34: Introduction to Continuous Integration

History

Page 35: Introduction to Continuous Integration

Summary• CI and Build pipeline improve

• Quality

• Time to market

• Confidence

• Continuous Deployment/Delivery is the next step

• Require Developers and System Administrator to work closely together

Page 36: Introduction to Continuous Integration

3 persons/group

Page 37: Introduction to Continuous Integration

Your Build Pipeline

?

Page 38: Introduction to Continuous Integration

Build/Deployment Pipeline

1. Clean 2. Checkout3. Download

Library4. Compile

5. Package 6. Setup DB 7. Run Test 8. Deploy

Page 39: Introduction to Continuous Integration

How to Self-Testing ?

Page 40: Introduction to Continuous Integration

What is Jenkins ?• Continuous Integration Server

• Opensource

• A lot of useful plugin

• Well document

• Active community

Page 41: Introduction to Continuous Integration

Goals

Push code

Push code

Review code

Build on push

Daily build

Test on push

Nightly regression

Performance testing

Page 42: Introduction to Continuous Integration

Let’s Go !!!