ge ng started with con1nuous integra1on
play

Ge#ng Started with Con1nuous Integra1on Beth Tucker Long - PowerPoint PPT Presentation

Ge#ng Started with Con1nuous Integra1on Beth Tucker Long @e3betht Who am I? Beth Tucker Long (@e3betht) PHP Developer at Code Climate


  1. Ge#ng ¡Started ¡with ¡ Con1nuous ¡Integra1on ¡ Beth ¡Tucker ¡Long ¡ @e3betht ¡

  2. Who ¡am ¡I? ¡ Beth ¡Tucker ¡Long ¡ ¡ ¡(@e3betht) ¡ • PHP ¡Developer ¡at ¡ ¡ Code ¡Climate ¡ • Stay-­‑at-­‑home ¡mom ¡ • User ¡group ¡leader ¡ • Mentor ¡& ¡Appren1ce ¡ ¡ @e3betht

  3. Audience ¡Par1cipa1on? ¡ • Yes, ¡there ¡will ¡be. ¡So, ¡when ¡I ¡ask ¡the ¡audience ¡ a ¡ques1on, ¡don’t ¡be ¡shy ¡about ¡answering. ¡ ¡ @e3betht

  4. Will ¡you ¡cover ¡everything? ¡ • No. ¡ @e3betht

  5. Con1nuous ¡Integra1on ¡ That’s ¡only ¡for ¡the ¡big ¡guys. ¡ ¡ My ¡team ¡is ¡small, ¡my ¡projects ¡are ¡small. ¡ ¡ So, ¡why ¡am ¡I ¡up ¡here? ¡ @e3betht

  6. What ¡is ¡con1nuous ¡integra1on? ¡ According ¡to ¡Wikipedia: ¡ ¡ In ¡soWware ¡engineering, ¡con1nuous ¡integra1on ¡(CI) ¡implements ¡ con1nuous ¡processes ¡of ¡applying ¡quality ¡control ¡— ¡small ¡ pieces ¡of ¡effort, ¡applied ¡frequently. ¡Con1nuous ¡integra1on ¡ aims ¡to ¡improve ¡the ¡quality ¡of ¡soWware, ¡and ¡to ¡reduce ¡the ¡1me ¡ taken ¡to ¡deliver ¡it, ¡by ¡replacing ¡the ¡tradi1onal ¡prac1ce ¡of ¡ applying ¡quality ¡control ¡aWer ¡comple1ng ¡all ¡development. ¡ ¡ hZp://en.wikipedia.org/wiki/Con1nuous_integra1on ¡ ¡ @e3betht

  7. Mar1n ¡Fowler ¡-­‑ ¡ hZp://mar1nfowler.com/ar1cles/ con1nuousIntegra1on.html ¡ ¡ ¡ ¡ @e3betht

  8. Con1nuous ¡Integra1on ¡is… ¡ …a ¡soWware ¡development ¡prac1ce ¡where ¡members ¡of ¡ a ¡team ¡integrate ¡their ¡work ¡frequently, ¡usually ¡each ¡ person ¡integrates ¡at ¡least ¡daily ¡-­‑ ¡leading ¡to ¡mul1ple ¡ ¡ integra1ons ¡per ¡day. ¡Each ¡integra1on ¡is ¡verified ¡by ¡an ¡ ¡ automated ¡build ¡(including ¡test) ¡to ¡detect ¡integra1on ¡ errors ¡as ¡quickly ¡as ¡possible. ¡Many ¡teams ¡find ¡that ¡ this ¡approach ¡leads ¡to ¡significantly ¡reduced ¡ integra1on ¡problems ¡and ¡allows ¡a ¡team ¡to ¡develop ¡ cohesive ¡soWware ¡more ¡rapidly. ¡ @e3betht

  9. Step ¡1 ¡ Con1nuous ¡Integra1on ¡is ¡a ¡soWware ¡development ¡prac1ce ¡ where ¡members ¡of ¡a ¡team ¡integrate ¡their ¡work ¡frequently, ¡ usually ¡each ¡person ¡integrates ¡at ¡least ¡daily ¡-­‑ ¡leading ¡to ¡ ¡ mul1ple ¡integra1ons ¡per ¡day. ¡ ¡ @e3betht

  10. Step ¡2 ¡ Each ¡integra1on ¡is ¡verified ¡by ¡an ¡automated ¡build ¡ (including ¡test) ¡to ¡detect ¡integra1on ¡errors ¡as ¡quickly ¡ ¡ as ¡possible. ¡ ¡ @e3betht

  11. Code ¡Quality ¡ Why? ¡ ¡ • Easier ¡to ¡test ¡ ¡ • Easier ¡to ¡measure ¡ ¡ • Easier ¡to ¡follow ¡ • Streamlines ¡the ¡development ¡process ¡ @e3betht

  12. Use ¡the ¡"S" ¡Word ¡ Standards! ¡ @e3betht

  13. Use ¡the ¡"S" ¡Word ¡ Wait, ¡lots ¡of ¡standards? ¡ @e3betht

  14. Popular ¡Standards ¡ • PHP ¡Framework ¡Interoperability ¡Group ¡(PHP-­‑FIG) ¡-­‑ ¡ hZp://www.php-­‑fig.org/ ¡ ¡ ¡ ¡ • PSR ¡-­‑ ¡PHP ¡Standard ¡Recommenda1on ¡ ¡ @e3betht

  15. PSR-­‑1 ¡ • Files ¡must ¡only ¡use ¡<?php ¡and ¡<?= ¡tags. ¡ • Class ¡names ¡must ¡be ¡declared ¡in ¡StudlyCaps. ¡ • Method ¡names ¡must ¡be ¡declared ¡in ¡camelCase. ¡ @e3betht

  16. PSR-­‑2 ¡ • Code ¡must ¡use ¡4 ¡spaces ¡for ¡inden1ng, ¡not ¡tabs. ¡ • Opening ¡braces ¡must ¡go ¡on ¡the ¡next ¡line ¡for ¡ classes ¡and ¡methods, ¡but ¡on ¡the ¡same ¡line ¡for ¡ control ¡structures. ¡ • Control ¡structure ¡keywords ¡must ¡have ¡one ¡space ¡ aWer ¡them; ¡method ¡and ¡func1on ¡calls ¡must ¡not. ¡ @e3betht

  17. PHP ¡Coding ¡Standards ¡Fixer ¡ hZp://cs.sensiolabs.org ¡ ¡ • Fixes ¡"most" ¡issues ¡ • PSR-­‑1 ¡and ¡PSR-­‑2 ¡compliant ¡ @e3betht

  18. Other ¡Standards ¡ • Zend ¡Framework ¡ • WordPress ¡ • Symfony ¡ • Pear ¡ @e3betht

  19. Custom ¡Standards ¡ • Broad ¡ • Strict, ¡but ¡flexible ¡ • Based ¡on ¡a ¡“standard” ¡standard ¡ • Everyone ¡must ¡follow ¡ @e3betht

  20. PHP_CodeSniffer ¡ "tokenizes ¡your ¡PHP, ¡JavaScript ¡and ¡CSS ¡files ¡and ¡ detects ¡viola1ons ¡of ¡a ¡defined ¡set ¡of ¡coding ¡ standards“ ¡ hZps://github.com/squizlabs/PHP_CodeSniffer ¡ ¡ ¡ • Phar, ¡Composer, ¡or ¡PEAR ¡installa1on ¡ • Single ¡file ¡or ¡en1re ¡directory ¡ • Preset ¡and ¡customizable ¡ • Will ¡fix ¡items ¡for ¡you ¡automa1cally ¡ @e3betht

  21. Output ¡ $ ¡phpcs ¡/myDir/myFile.php ¡ FILE: ¡/myDir/myFile.php ¡ -­‑-­‑-­‑-­‑-­‑-­‑-­‑-­‑-­‑-­‑-­‑-­‑-­‑-­‑-­‑-­‑-­‑-­‑-­‑-­‑-­‑-­‑-­‑-­‑-­‑-­‑-­‑-­‑-­‑-­‑-­‑-­‑-­‑-­‑-­‑-­‑-­‑-­‑-­‑-­‑-­‑-­‑-­‑-­‑-­‑-­‑-­‑-­‑-­‑-­‑-­‑-­‑-­‑-­‑-­‑-­‑-­‑-­‑-­‑-­‑-­‑-­‑-­‑-­‑-­‑-­‑-­‑-­‑-­‑-­‑-­‑-­‑-­‑-­‑-­‑-­‑-­‑-­‑-­‑-­‑ ¡ FOUND ¡3 ¡ERROR(S) ¡AFFECTING ¡3 ¡LINE(S) ¡ -­‑-­‑-­‑-­‑-­‑-­‑-­‑-­‑-­‑-­‑-­‑-­‑-­‑-­‑-­‑-­‑-­‑-­‑-­‑-­‑-­‑-­‑-­‑-­‑-­‑-­‑-­‑-­‑-­‑-­‑-­‑-­‑-­‑-­‑-­‑-­‑-­‑-­‑-­‑-­‑-­‑-­‑-­‑-­‑-­‑-­‑-­‑-­‑-­‑-­‑-­‑-­‑-­‑-­‑-­‑-­‑-­‑-­‑-­‑-­‑-­‑-­‑-­‑-­‑-­‑-­‑-­‑-­‑-­‑-­‑-­‑-­‑-­‑-­‑-­‑-­‑-­‑-­‑-­‑-­‑ ¡ ¡ ¡2 ¡ ¡| ¡ERROR ¡| ¡[ ¡ ¡] ¡Missing ¡file ¡doc ¡comment ¡ ¡20 ¡| ¡ERROR ¡| ¡[x] ¡PHP ¡keywords ¡must ¡be ¡lowercase; ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡expected ¡"false" ¡but ¡found ¡"FALSE" ¡ ¡47 ¡| ¡ERROR ¡| ¡[x] ¡Line ¡not ¡indented ¡correctly; ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡expected ¡4 ¡spaces ¡but ¡found ¡1 ¡ -­‑-­‑-­‑-­‑-­‑-­‑-­‑-­‑-­‑-­‑-­‑-­‑-­‑-­‑-­‑-­‑-­‑-­‑-­‑-­‑-­‑-­‑-­‑-­‑-­‑-­‑-­‑-­‑-­‑-­‑-­‑-­‑-­‑-­‑-­‑-­‑-­‑-­‑-­‑-­‑-­‑-­‑-­‑-­‑-­‑-­‑-­‑-­‑-­‑-­‑-­‑-­‑-­‑-­‑-­‑-­‑-­‑-­‑-­‑-­‑-­‑-­‑-­‑-­‑-­‑-­‑-­‑-­‑-­‑-­‑-­‑-­‑-­‑-­‑-­‑-­‑-­‑-­‑-­‑-­‑ ¡ @e3betht

  22. Monitoring ¡Code ¡Quality ¡ Sensio ¡Insight ¡ hZps://insight.sensiolabs.com/ ¡ ¡ • Free ¡for ¡open ¡source ¡ • Integrated ¡with ¡Git ¡ • Symfony-­‑focused, ¡but ¡works ¡with ¡any ¡PHP ¡ code ¡ • Checks ¡PHP, ¡XML, ¡YAML, ¡Twig ¡templates, ¡ and ¡Composer ¡dependencies ¡ @e3betht

  23. Monitoring ¡Code ¡Quality ¡ Scru1nizer ¡ hZps://scru1nizer-­‑ci.com/ ¡ ¡ • Free ¡for ¡open ¡source ¡ • Integrated ¡with ¡Git ¡ • Integrates ¡open ¡source ¡ checking ¡tools ¡like ¡ PHP_CodeSniffer ¡and ¡PHP ¡ Mess ¡Detector ¡ ¡ • Checks ¡PHP, ¡Python, ¡and ¡ Ruby ¡ @e3betht

  24. Monitoring ¡Code ¡Quality ¡ Codacy ¡ hZps://www.codacy.com ¡ ¡ • Free ¡for ¡open ¡source ¡ • Integrated ¡with ¡Git ¡ • Integrates ¡open ¡source ¡ checking ¡tools ¡like ¡ PHP_CodeSniffer ¡and ¡PHP ¡ Mess ¡Detector ¡ ¡ • Checks ¡PHP, ¡Python, ¡Scala, ¡ JavaScript, ¡and ¡CSS ¡ @e3betht

  25. Monitoring ¡Code ¡Quality ¡ Code ¡Climate ¡ hZps://codeclimate.com/ ¡ • Free ¡for ¡open ¡source ¡ • Integrated ¡with ¡Git ¡ • Hosted ¡or ¡on-­‑site ¡versions ¡ • Quality, ¡security, ¡style, ¡ ¡ and ¡bug ¡risk ¡checks ¡ • Checks ¡PHP, ¡JavaScript, ¡ Python, ¡and ¡Ruby ¡ • Takes ¡security ¡seriously: ¡ codeclimate.com/security ¡ ¡ @e3betht

  26. Unit ¡Tests ¡ Unit ¡-­‑ ¡the ¡smallest ¡piece ¡of ¡testable ¡code ¡within ¡my ¡ applica1on ¡or ¡script. ¡ ¡ Unit ¡test ¡ -­‑ ¡a ¡piece ¡of ¡code ¡that ¡executes ¡the ¡unit ¡ and ¡then ¡evaluates ¡the ¡result ¡returned. ¡ @e3betht

Download Presentation
Download Policy: The content available on the website is offered to you 'AS IS' for your personal information and use only. It cannot be commercialized, licensed, or distributed on other websites without prior consent from the author. To download a presentation, simply click this link. If you encounter any difficulties during the download process, it's possible that the publisher has removed the file from their server.

Recommend


More recommend