the continuous talk

29
The Continuous Talk © 2015 Continuous S.A. - All rights reserved.

Upload: continuousphp

Post on 13-Aug-2015

385 views

Category:

Internet


0 download

TRANSCRIPT

Page 1: The Continuous talk

The Continuous Talk

© 2015 Continuous S.A. - All rights reserved.

Page 2: The Continuous talk

About myself: Frederic Dewinne

• CTO & Co-Founder of continuousphp©

• 15+ SysAdmin/PHP consultant background

• PHP Certified Engineer

• Continuous Delivery/Deployment Evangelist

http://lu.linkedin.com/in/fredericdewinne

@fdewinne

© 2015 Continuous S.A. - All rights reserved.

Page 3: The Continuous talk

Continuous what?

© 2015 Continuous S.A. - All rights reserved.

Page 4: The Continuous talk

Continuous Integration (CI)• continuously merging developer branches in a

common one

• build and test every commit to prevent integration issues

• deploy every build on an integration server

© 2015 Continuous S.A. - All rights reserved.

Page 5: The Continuous talk

Continuous Delivery (CD)• Continuous Integration is a part of CD

• Code is packaged by a build server every time a change is committed

• any code commit may be released to customers at any point

• implements Scrum Project Management© 2015 Continuous S.A. - All rights reserved.

Page 6: The Continuous talk

Continuous Deployment• Continuous Delivery is a part of Continuous

Deployment

• every successful build is deployed to a Production Environment

• any completed, working feature is delivered to production as soon as possible

• implements Kanban Project Management© 2015 Continuous S.A. - All rights reserved.

Page 7: The Continuous talk

Comparison

Feature

Code Build Test Release Deploy OperateFeatureFeature

Continuous Integration

Continuous Delivery

Continuous Deployment

© 2015 Continuous S.A. - All rights reserved.

Agile Development

Page 8: The Continuous talk

Library development workflow• Continuous Integration & Continuous Delivery only!

• need to integrate a new version of the library in the app using it, to trigger the application build

• can trigger client application update on new release• update client application’s dependency manager• trigger a new build of the application

© 2015 Continuous S.A. - All rights reserved.

Page 9: The Continuous talk

Master

Hot Fix

Release

Develop

Feature

Feature

V0.1.0 V0.1.1 V0.2.0

Continuous Delivery

Continuous Deployment

http://nvie.com/posts/a-successful-git-branching-model/

Branching model

© 2015 Continuous S.A. - All rights reserved.

Page 10: The Continuous talk

Semantic Versioning• naming convention to use for Continuous Deployment & Continuous

Delivery

• <MAJOR>.<MINOR>.<PATCH>

• MAJOR version for backward compatibility breaks• MINOR version for backwards-compatible features• PATCH version for backwards-compatible bug fixes

© 2015 Continuous S.A. - All rights reserved.

Page 11: The Continuous talk

The tool: Git-Flow

• Install:

• Linux: sudo apt-get install git-flow (on Debian/Ubuntu)• Mac: brew install git-flow

cd /my/project/rootgit flow initgit flow <feature|hotfix|release> <start|finish|publish> <version#|feature name>

• Git-Flow Tutorial: http://danielkummer.github.io/git-flow-cheatsheet/

© 2015 Continuous S.A. - All rights reserved.

Page 12: The Continuous talk

How to manage our builds ?

© 2015 Continuous S.A. - All rights reserved.

Page 13: The Continuous talk

The build goals

• prepare the application for use in production• … and for testing purposes

• … even for development

© 2015 Continuous S.A. - All rights reserved.

Page 14: The Continuous talk

“Sounds nice, but our project is too specific!”

© 2015 Continuous S.A. - All rights reserved.

Page 15: The Continuous talk

No, it’s all about provisioning and dependencies!

© 2015 Continuous S.A. - All rights reserved.

Page 16: The Continuous talk

System dependencies

• database• file stores

• web services• cache• ...

© 2015 Continuous S.A. - All rights reserved.

Page 17: The Continuous talk

Code dependencies

• third party libraries• configuration files

© 2015 Continuous S.A. - All rights reserved.

Page 18: The Continuous talk

How to manage them?

© 2015 Continuous S.A. - All rights reserved.

Page 19: The Continuous talk

Composer

• Dependency Manager for PHP• focused on library dependencies• define php version and extension requirements

• https://getcomposer.org

© 2015 Continuous S.A. - All rights reserved.

Page 20: The Continuous talk

Phing

• PHing Is Not GNU make• PHP Project build tool• based on Apache Ant

• written in PHP; easily extensible by PHP developers• define sequences of tasks• organized in targets

© 2015 Continuous S.A. - All rights reserved.

Page 21: The Continuous talk

Database migration tools

• Doctrine Migrations• Magic with Doctrine ORM• Compatible only with MySQL

• Phinx• dbdeploy

• Or simply uses nosql databases :)

© 2015 Continuous S.A. - All rights reserved.

Page 22: The Continuous talk

I’m not confident enough with my code :(

© 2015 Continuous S.A. - All rights reserved.

Page 23: The Continuous talk

How do you test your code ?

© 2015 Continuous S.A. - All rights reserved.

Page 24: The Continuous talk

Acceptance Testing with Behat

• Inspired by Cucumber• Uses Gherkin syntax to define specs• Supports several web browser drivers through

extensions

© 2015 Continuous S.A. - All rights reserved.

Page 25: The Continuous talk

Unit Testing Tools• PHPUnit

• de facto industry standard• created in 2001

• phpspec• tests designed by specification• eases TDD approach

• atoum• simple and intuitive• Good performances

© 2015 Continuous S.A. - All rights reserved.

Page 26: The Continuous talk

GUITests

AcceptanceTests

UnitTests

Test pyramid

© 2015 Continuous S.A. - All rights reserved.

Page 27: The Continuous talk

Continuous Deployment… take also cares about deployment!

© 2015 Continuous S.A. - All rights reserved.

Page 28: The Continuous talk

Deployment Tools• Amazon CodeDeploy

• Used by amazon.com for years• Support deploy on boot• Support rollback• Support transitional deploy• Free on AWS

• Zend Deployment• Included in Zend Server• Support rollback• Support transitional deploy

© 2015 Continuous S.A. - All rights reserved.

Page 29: The Continuous talk

Thank you!

https://www.facebook.com/pages/ContinuousPHP/183047251848548

@continuousphp

https://www.linkedin.com/company/continuousphp

https://www.google.com/+Continuousphp

continuousphp.com© 2015 Continuous S.A. - All rights reserved.