Continuous Integration Step-by-step

Loading...

Flash Player 9 (or above) is needed to view presentations.
We have detected that you do not have it on your computer. To install it, go here.

0 comments

Post a comment

    Post a comment
    Embed Video
    Edit your comment Cancel

    Notes on slide 1





    convince audience this is BAD
    who knows / does this ???







    Versioning essentials



    PHPUnit is a separate talk (see Sebastian Bergmann)










    1 Favorite & 1 Event

    Continuous Integration Step-by-step - Presentation Transcript

    1. Continuous Integration Step-by-step php|tek Chicago 2009
    2. Who am I ? Michelangelo van Dam Independent Enterprise PHP consultant Co-founder PHPBelgium Mail me at dragonbe [at] gmail [dot] com Follow me on http://twitter.com/DragonBe Read my articles on http://dragonbe.com See my profile on http://linkedin.com/in/michelangelovandam 2
    3. Topics • Development practices • PHP Toolset - Live Development - Subversion - Shared Drive - PHPDocumentor - Staged Environments - PHPUnit - Version Control - Xdebug - Automation - Phing - Continuous - CI Integration 3
    4. Development Practices 4
    5. Live Development • development on “live” server • errors, failures and warnings exposed • potential security risks • no way to revert back (w/o backups) 5
    6. Shared drive • using a shared drive to store code base • risk of overwriting each other’s work • code is uploaded to “live” server for testing • quick fixes occur on “live” environments for speed • same issues as with “live development” 6
    7. Staged Environments • separate platform for each “stage” of development - LOCAL for local development - DEV to combine all development of all developers - TEST to test the application(s) - ACC for acceptance by the customer(s) - PROD as production or “live” system 7
    8. Version Control • each change of code is registered (revision) • code conflicts are detected • release management possible • reverting to previous revisions • backup 8
    9. Automation • write once, run many • is less vulnerable to human error - humans still write scripts to automate processes ! • can be scheduled, triggered, pushed and pulled • behaves always in the same way - so results can be predictable 9
    10. Continuous Integration • automated process - build - test - deploy • in a continuous way - after each commit into versioning system - at specific intervals (e.g. nightly builds) • always a “deployable” release 10
    11. PHP Toolset 11
    12. Versioning your code • Subversion - more options then CVS - can be integrated with GIT • easy set up / maintain - all OSes (Windows, Mac, Linux, ...) - great support in tools (IDE and regular clients) • good documentation (http://subversion.tigris.org) 12
    13. Document your code • PHPDocumentor www.phpdocumentor.org • provides immediate API documentation • based on in-code documentation 13
    14. Check your code • PHPLint • checks your code on coding errors • creates documentation based on source code • http://www.icosaedro.it/phplint/ • or use php -l <file.php> 14
    15. Test your code • PHPUnit (phpunit.de) - family of the xUnit testing suites • easy to learn, hard to do ... • easy to install (using PEAR) • provides extra features - code duplication detection (cdd) - code coverage reporting (with Xdebug) - test driven documentation 15
    16. Debug your code • Xdebug (xdebug.org) - advanced debug reporting - profiling features • Integrates well with other tools (like PHPUnit) 16
    17. Validate your code • PHP_CodeSniffer • PEAR package • checks your code for coding standards • http://pear.php.net/package/PHP_CodeSniffer 17
    18. Build your code • Phing (phing.info) • alternate for ANT • building is more automating previous steps • ensures you’ll run all steps the same way 18
    19. Let’s automate this all ! • CruiseControl as your CI system • phpUnderControl has a more detailed interface • uses Phing build files to process all previous steps • generates reports for each stage • triggered by - commits into the repository - scheduled building processes (e.g. each night) 19
    20. Example phing build.xml 20
    21. Conclusion CI automates manual processes continues to do so on each cycle (“continuous”) reports on successes and failures frees up versioning system resources 21
    22. Credits Lomo elePHPant http://www.flickr.com/photos/jakobwesthoff/3231273333/ ElePHPant to the rescue http://www.flickr.com/photos/tobiasschlitt/2733763988/ 22
    23. License This presentation is released under the Creative Commons Attribution-Share Alike 3.0 Unported License You are free: - to share : to copy, distribute and transmit the work - to remix : to adapt the work Under the following conditions: - attribution :You must attribute the work in the manner specified by the author or licensor - share alike : If you alter, transform, or build upon this work, you may distribute the resulting work only under the same, similar or a compatible license See: http://creativecommons.org/licenses/by-sa/3.0/ 23
    24. Thank you Slides available on http://slideshare.net/DragonBe Vote this presentation on http://joind.in/444 24

    + Michelangelo van DamMichelangelo van Dam, 5 months ago

    custom

    1569 views, 1 favs, 0 embeds more stats

    Starting of with familiar circumstances that all de more

    More info about this document

    CC Attribution-NonCommercial-ShareAlike LicenseCC Attribution-NonCommercial-ShareAlike LicenseCC Attribution-NonCommercial-ShareAlike License

    Go to text version

    • Total Views 1569
      • 1569 on SlideShare
      • 0 from embeds
    • Comments 0
    • Favorites 1
    • Downloads 0
    Most viewed embeds

    more

    All embeds

    less

    Flagged as inappropriate Flag as inappropriate
    Flag as inappropriate

    Select your reason for flagging this presentation as inappropriate. If needed, use the feedback form to let us know more details.

    Cancel
    File a copyright complaint
    Having problems? Go to our helpdesk?

    Categories

    Groups / Events