12
  INDUSTRIALISATION (avec PHP) > Conférence MMI Connect > 06 Décembre 2014

l'Industrialisation (avec PHP) @MMIConnect

Embed Size (px)

Citation preview

Page 1: l'Industrialisation (avec PHP) @MMIConnect

  

INDUSTRIALISATION (avec PHP)

> Conférence MMI Connect> 06 Décembre 2014

Page 2: l'Industrialisation (avec PHP) @MMIConnect

Florent DenisDéveloppeur PHP Sénior @Paris

● Promo 2007/2009 SRC + 1 an licence SLIC + 2 ans PSM

● 2 ans chez Ekino (Fullsix)

● Depuis octobre chez Oxent.

● 7 ans de PHP (depuis le lycée)

● twitter.com/florentdenis

● github.com/pokap

 

Qui suis­je ?

Page 3: l'Industrialisation (avec PHP) @MMIConnect

Pourquoi faire de l'industrialisation ?

Et pourquoi du standard ?● Tout le monde connaît (normalement) les standards.

● Ne pas réinventer la roue

● Avoir un processus de travail valide

● Projet collaboratif

● Documentation

● Le code en anglais

Standard > Devops > Intégration continue > Déploiement 

Standard

Page 4: l'Industrialisation (avec PHP) @MMIConnect

PHP : www.php-fig.comPHP Framework Interop Group

● Agavi - David Zülke (@dzuelke)

● AWS SDK for PHP (Amazon Web Services) - Michael Dowling (@mtdowling)

● Apache log4php - Ivan Habunek (@ihabunek)

● Assetic and Buzz - Kris Wallsmith (@kriswallsmith)

● Aura Project and Solar Framework - Paul M. Jones (@pmjones)

● CakePHP - Larry Masters (@PhpNut)

● Composer - Jordi Boggiano (@seldaek)

● Concrete5 - Korvin Szanto (@korvinszanto)

● Contao Open Source CMS - Leo Feyer (@leofeyer)

● Doctrine - Guilherme Blanco (@guilhermeblanco)

● Drupal - Larry Garfield (@Crell)

● eZ Publish - Andre Romcke (@andrerom)

● TYPO3 Flow - Karsten Dambekalns (@kdambekalns)

● Jackalope - Lukas Kahwe Smith (@lsmith)

● Joomla - Don Gilbert (@dilbert4life)

● Laravel - Taylor Otwell (@taylorotwell)

● Lithium - Nate Abele (@nateabele)

● PEAR - Brett Bieber (@saltybeagle)

● Phalcon - Andres Gutierrez (@phalconphp)

Standard > Devops > Intégration continue > Déploiement

● Phing - Michiel Rook (@michieltcs)

● phpBB - Nils Adermann (@naderman)

● phpDocumentor - Mike van Riel (@mvriel)

● PPI Framework - Paul Dragoonis (@dr4goonis)

● PrestaShop - Rémi Gaillard (@xtaz07)

● Propel - William Durand (@couac)

● PyroCMS - Phil Sturgeon (@philsturgeon)

● Revive Adserver - Matteo Beccati (@mbeccati)

● SabreDAV - Evert Pot (@evertp)

● Sculpin - Beau D. Simensen (@beausimensen)

● Stash - Robert Hafner (@tedivm)

● SugarCRM - Filipe Guerra (@alias_mac)

● Symfony2 - Bernhard Schussek (@webmozart)

● The community at large - Cal Evans (@CalEvans)

● Wikibase and Semantic MediaWiki - Jeroen De Dauw (@JeroenDeDauw)

● Yii framework - Alexander Makarov (@sam_dark)

● Zend Framework 2 - Pádraic Brady (@padraicb)

● Zikula - Karma Dordrak (@zikuladrak)

Page 5: l'Industrialisation (avec PHP) @MMIConnect

Dépendances de librairieAvec composer

● packagist.org

● 43 408 packages registered

● 177 225 versions available

● 433 926 554 packages installed (since 2012-04-13)

● Semantic Versioning : semver.org

Standard > Devops > Intégration continue > Déploiement

Page 6: l'Industrialisation (avec PHP) @MMIConnect

Trop d'environnements ● Quel runtime php choisir ?

php-cgi, php-fpm, mod_php5, hhvm, hippyvm, …

● Quelle distribution ?

Ubuntu, Debian, Redhat, Centos, Windows, …

● Et quels logiciels nécessaires ?

Mysql, Mariadb, Mongodb, Memcached, Redis, Varnish, Nginx, RabbitMQ, …

● Combien de développeurs dans votre équipe ?

Standard > Devops > Intégration continue > Déploiement 

Devops

Page 7: l'Industrialisation (avec PHP) @MMIConnect

VagrantVirtual environments

Si ça marche en local, ça marche en prod.

● Couche d'abstraction pour contrôler votre machine virtuel

VirtualBox, VMWare, Docker ou Hyper-V

● Un simple fichier de configuration (Vagrantfile)

● Tous les développeurs travail sur la même base de travail

● Utiliser des outils de provisioning

Puppet ou Chef (ruby)

Standard > Devops > Intégration continue > Déploiement

Page 8: l'Industrialisation (avec PHP) @MMIConnect

Ou Assurance qualité (QA)

Ça commence avec les tests

et les tests c'est pour ceux qui savent coder

préambule (given) : place le système dans un état particulier (optionel)

+ données (when) : test, exécute le système

+ oracle (then) : établit le verdict

= cas de test

Valeurs du verdict : succès, échec ou inconclusif

Standard > Devops > Intégration continue > Déploiement 

Intégration continue

Page 9: l'Industrialisation (avec PHP) @MMIConnect

Outils de tests

● PHPUnit ou Atoum : Framework de tests unitaires

● Behat : Outils de scénario

– Behat + Mink = permet de faire des requêtes HTTP

– Drivers : Goutte, Selenium, BrowserKit, Zombie, etc.

● PHPSpec : Framework de spécification

Jenkins :

● Centralisation de tâches

● Cycle de tests & build

● Automatisation de déploiement

Standard > Devops > Intégration continue > Déploiement

Page 10: l'Industrialisation (avec PHP) @MMIConnect

La mise en production

Problèmes :

● Envoyer le code du projet sur un ou plusieurs serveur(s) distant(s).

● Lancer des tâches de mise à jour (assets, abonnements API, etc.)

● Être sûr d'avoir votre projet commit sur tous vos serveurs en même temps.

Solutions :

● Capistrano

● Fabric

● Deployer

Standard > Devops > Intégration continue > Déploiement 

Déploiement

Page 11: l'Industrialisation (avec PHP) @MMIConnect

Ce qui faut retenir :

● Respecter les standards

● Ne réinventez pas la roue

● Écrivez de la documentation

● Valider vos travaux

● Automatiser les tâches

Standard > Devops > Intégration continue > Déploiement 

Conclusion

Page 12: l'Industrialisation (avec PHP) @MMIConnect

Liste de chaîne youtube à suivre :

● AFUP PHP

● SensioLabs

● ELAO – Lyon

● DutchPHPConference

● takeoffconference

● Zend

● ...

Standard > Devops > Intégration continue > Déploiement 

Bonus : conférences