Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.

WordCamp Lyon 2015 - WordPress, Git et l'intégration continue

3,656 views

Published on

Retour d'expérience sur les pratiques que j'utilise au quotidien pour l'industrialisation de mes développements WordPress...

https://lyon.wordcamp.org/2015/session/wordpress-git-et-lintegration-continue/

Published in: Technology
  • DOWNLOAD THE BOOK INTO AVAILABLE FORMAT (New Update) ......................................................................................................................... ......................................................................................................................... Download Full PDF EBOOK here { https://urlzs.com/UABbn } ......................................................................................................................... Download Full EPUB Ebook here { https://urlzs.com/UABbn } ......................................................................................................................... Download Full doc Ebook here { https://urlzs.com/UABbn } ......................................................................................................................... Download PDF EBOOK here { https://urlzs.com/UABbn } ......................................................................................................................... Download EPUB Ebook here { https://urlzs.com/UABbn } ......................................................................................................................... Download doc Ebook here { https://urlzs.com/UABbn } ......................................................................................................................... ......................................................................................................................... ................................................................................................................................... eBook is an electronic version of a traditional print book THE can be read by using a personal computer or by using an eBook reader. (An eBook reader can be a software application for use on a computer such as Microsoft's free Reader application, or a book-sized computer THE is used solely as a reading device such as Nuvomedia's Rocket eBook.) Users can purchase an eBook on diskette or CD, but the most popular method of getting an eBook is to purchase a downloadable file of the eBook (or other reading material) from a Web site (such as Barnes and Noble) to be read from the user's computer or reading device. Generally, an eBook can be downloaded in five minutes or less ......................................................................................................................... .............. Browse by Genre Available eBOOK .............................................................................................................................. Art, Biography, Business, Chick Lit, Children's, Christian, Classics, Comics, Contemporary, CookBOOK, Manga, Memoir, Music, Mystery, Non Fiction, Paranormal, Philosophy, Poetry, Psychology, Religion, Romance, Science, Science Fiction, Self Help, Suspense, Spirituality, Sports, Thriller, Travel, Young Adult, Crime, EBOOK, Fantasy, Fiction, Graphic Novels, Historical Fiction, History, Horror, Humor And Comedy, ......................................................................................................................... ......................................................................................................................... .....BEST SELLER FOR EBOOK RECOMMEND............................................................. ......................................................................................................................... Blowout: Corrupted Democracy, Rogue State Russia, and the Richest, Most Destructive Industry on Earth,-- The Ride of a Lifetime: Lessons Learned from 15 Years as CEO of the Walt Disney Company,-- Call Sign Chaos: Learning to Lead,-- StrengthsFinder 2.0,-- Stillness Is the Key,-- She Said: Breaking the Sexual Harassment Story THE Helped Ignite a Movement,-- Atomic Habits: An Easy & Proven Way to Build Good Habits & Break Bad Ones,-- Everything Is Figureoutable,-- What It Takes: Lessons in the Pursuit of Excellence,-- Rich Dad Poor Dad: What the Rich Teach Their Kids About Money THE the Poor and Middle Class Do Not!,-- The Total Money Makeover: Classic Edition: A Proven Plan for Financial Fitness,-- Shut Up and Listen!: Hard Business Truths THE Will Help You Succeed, ......................................................................................................................... .........................................................................................................................
       Reply 
    Are you sure you want to  Yes  No
    Your message goes here
  • DOWNLOAD THIS BOOKS INTO AVAILABLE FORMAT (2019 Update) ......................................................................................................................... ......................................................................................................................... Download Full PDF EBOOK here { https://soo.gd/irt2 } ......................................................................................................................... Download Full EPUB Ebook here { https://soo.gd/irt2 } ......................................................................................................................... Download Full doc Ebook here { https://soo.gd/irt2 } ......................................................................................................................... Download PDF EBOOK here { https://soo.gd/irt2 } ......................................................................................................................... Download EPUB Ebook here { https://soo.gd/irt2 } ......................................................................................................................... Download doc Ebook here { https://soo.gd/irt2 } ......................................................................................................................... ......................................................................................................................... ................................................................................................................................... eBook is an electronic version of a traditional print book THIS can be read by using a personal computer or by using an eBook reader. (An eBook reader can be a software application for use on a computer such as Microsoft's free Reader application, or a book-sized computer THIS is used solely as a reading device such as Nuvomedia's Rocket eBook.) Users can purchase an eBook on diskette or CD, but the most popular method of getting an eBook is to purchase a downloadable file of the eBook (or other reading material) from a Web site (such as Barnes and Noble) to be read from the user's computer or reading device. Generally, an eBook can be downloaded in five minutes or less ......................................................................................................................... .............. Browse by Genre Available eBooks .............................................................................................................................. Art, Biography, Business, Chick Lit, Children's, Christian, Classics, Comics, Contemporary, Cookbooks, Manga, Memoir, Music, Mystery, Non Fiction, Paranormal, Philosophy, Poetry, Psychology, Religion, Romance, Science, Science Fiction, Self Help, Suspense, Spirituality, Sports, Thriller, Travel, Young Adult, Crime, Ebooks, Fantasy, Fiction, Graphic Novels, Historical Fiction, History, Horror, Humor And Comedy, ......................................................................................................................... ......................................................................................................................... .....BEST SELLER FOR EBOOK RECOMMEND............................................................. ......................................................................................................................... Blowout: Corrupted Democracy, Rogue State Russia, and the Richest, Most Destructive Industry on Earth,-- The Ride of a Lifetime: Lessons Learned from 15 Years as CEO of the Walt Disney Company,-- Call Sign Chaos: Learning to Lead,-- StrengthsFinder 2.0,-- Stillness Is the Key,-- She Said: Breaking the Sexual Harassment Story THIS Helped Ignite a Movement,-- Atomic Habits: An Easy & Proven Way to Build Good Habits & Break Bad Ones,-- Everything Is Figureoutable,-- What It Takes: Lessons in the Pursuit of Excellence,-- Rich Dad Poor Dad: What the Rich Teach Their Kids About Money THIS the Poor and Middle Class Do Not!,-- The Total Money Makeover: Classic Edition: A Proven Plan for Financial Fitness,-- Shut Up and Listen!: Hard Business Truths THIS Will Help You Succeed, ......................................................................................................................... .........................................................................................................................
       Reply 
    Are you sure you want to  Yes  No
    Your message goes here
  • DOWNLOAD THIS BOOKS INTO AVAILABLE FORMAT (2019 Update) ......................................................................................................................... ......................................................................................................................... Download Full PDF EBOOK here { https://soo.gd/irt2 } ......................................................................................................................... Download Full EPUB Ebook here { https://soo.gd/irt2 } ......................................................................................................................... Download Full doc Ebook here { https://soo.gd/irt2 } ......................................................................................................................... Download PDF EBOOK here { https://soo.gd/irt2 } ......................................................................................................................... Download EPUB Ebook here { https://soo.gd/irt2 } ......................................................................................................................... Download doc Ebook here { https://soo.gd/irt2 } ......................................................................................................................... ......................................................................................................................... ................................................................................................................................... eBook is an electronic version of a traditional print book THIS can be read by using a personal computer or by using an eBook reader. (An eBook reader can be a software application for use on a computer such as Microsoft's free Reader application, or a book-sized computer THIS is used solely as a reading device such as Nuvomedia's Rocket eBook.) Users can purchase an eBook on diskette or CD, but the most popular method of getting an eBook is to purchase a downloadable file of the eBook (or other reading material) from a Web site (such as Barnes and Noble) to be read from the user's computer or reading device. Generally, an eBook can be downloaded in five minutes or less ......................................................................................................................... .............. Browse by Genre Available eBooks .............................................................................................................................. Art, Biography, Business, Chick Lit, Children's, Christian, Classics, Comics, Contemporary, Cookbooks, Manga, Memoir, Music, Mystery, Non Fiction, Paranormal, Philosophy, Poetry, Psychology, Religion, Romance, Science, Science Fiction, Self Help, Suspense, Spirituality, Sports, Thriller, Travel, Young Adult, Crime, Ebooks, Fantasy, Fiction, Graphic Novels, Historical Fiction, History, Horror, Humor And Comedy, ......................................................................................................................... ......................................................................................................................... .....BEST SELLER FOR EBOOK RECOMMEND............................................................. ......................................................................................................................... Blowout: Corrupted Democracy, Rogue State Russia, and the Richest, Most Destructive Industry on Earth,-- The Ride of a Lifetime: Lessons Learned from 15 Years as CEO of the Walt Disney Company,-- Call Sign Chaos: Learning to Lead,-- StrengthsFinder 2.0,-- Stillness Is the Key,-- She Said: Breaking the Sexual Harassment Story THIS Helped Ignite a Movement,-- Atomic Habits: An Easy & Proven Way to Build Good Habits & Break Bad Ones,-- Everything Is Figureoutable,-- What It Takes: Lessons in the Pursuit of Excellence,-- Rich Dad Poor Dad: What the Rich Teach Their Kids About Money THIS the Poor and Middle Class Do Not!,-- The Total Money Makeover: Classic Edition: A Proven Plan for Financial Fitness,-- Shut Up and Listen!: Hard Business Truths THIS Will Help You Succeed, ......................................................................................................................... .........................................................................................................................
       Reply 
    Are you sure you want to  Yes  No
    Your message goes here
  • DOWNLOAD THIS BOOKS INTO AVAILABLE FORMAT (2019 Update) ......................................................................................................................... ......................................................................................................................... Download Full PDF EBOOK here { https://soo.gd/irt2 } ......................................................................................................................... Download Full EPUB Ebook here { https://soo.gd/irt2 } ......................................................................................................................... Download Full doc Ebook here { https://soo.gd/irt2 } ......................................................................................................................... Download PDF EBOOK here { https://soo.gd/irt2 } ......................................................................................................................... Download EPUB Ebook here { https://soo.gd/irt2 } ......................................................................................................................... Download doc Ebook here { https://soo.gd/irt2 } ......................................................................................................................... ......................................................................................................................... ................................................................................................................................... eBook is an electronic version of a traditional print book THIS can be read by using a personal computer or by using an eBook reader. (An eBook reader can be a software application for use on a computer such as Microsoft's free Reader application, or a book-sized computer THIS is used solely as a reading device such as Nuvomedia's Rocket eBook.) Users can purchase an eBook on diskette or CD, but the most popular method of getting an eBook is to purchase a downloadable file of the eBook (or other reading material) from a Web site (such as Barnes and Noble) to be read from the user's computer or reading device. Generally, an eBook can be downloaded in five minutes or less ......................................................................................................................... .............. Browse by Genre Available eBooks .............................................................................................................................. Art, Biography, Business, Chick Lit, Children's, Christian, Classics, Comics, Contemporary, Cookbooks, Manga, Memoir, Music, Mystery, Non Fiction, Paranormal, Philosophy, Poetry, Psychology, Religion, Romance, Science, Science Fiction, Self Help, Suspense, Spirituality, Sports, Thriller, Travel, Young Adult, Crime, Ebooks, Fantasy, Fiction, Graphic Novels, Historical Fiction, History, Horror, Humor And Comedy, ......................................................................................................................... ......................................................................................................................... .....BEST SELLER FOR EBOOK RECOMMEND............................................................. ......................................................................................................................... Blowout: Corrupted Democracy, Rogue State Russia, and the Richest, Most Destructive Industry on Earth,-- The Ride of a Lifetime: Lessons Learned from 15 Years as CEO of the Walt Disney Company,-- Call Sign Chaos: Learning to Lead,-- StrengthsFinder 2.0,-- Stillness Is the Key,-- She Said: Breaking the Sexual Harassment Story THIS Helped Ignite a Movement,-- Atomic Habits: An Easy & Proven Way to Build Good Habits & Break Bad Ones,-- Everything Is Figureoutable,-- What It Takes: Lessons in the Pursuit of Excellence,-- Rich Dad Poor Dad: What the Rich Teach Their Kids About Money THIS the Poor and Middle Class Do Not!,-- The Total Money Makeover: Classic Edition: A Proven Plan for Financial Fitness,-- Shut Up and Listen!: Hard Business Truths THIS Will Help You Succeed, ......................................................................................................................... .........................................................................................................................
       Reply 
    Are you sure you want to  Yes  No
    Your message goes here
  • DOWNLOAD THIS BOOKS INTO AVAILABLE FORMAT (2019 Update) ......................................................................................................................... ......................................................................................................................... Download Full PDF EBOOK here { https://soo.gd/irt2 } ......................................................................................................................... Download Full EPUB Ebook here { https://soo.gd/irt2 } ......................................................................................................................... Download Full doc Ebook here { https://soo.gd/irt2 } ......................................................................................................................... Download PDF EBOOK here { https://soo.gd/irt2 } ......................................................................................................................... Download EPUB Ebook here { https://soo.gd/irt2 } ......................................................................................................................... Download doc Ebook here { https://soo.gd/irt2 } ......................................................................................................................... ......................................................................................................................... ................................................................................................................................... eBook is an electronic version of a traditional print book THIS can be read by using a personal computer or by using an eBook reader. (An eBook reader can be a software application for use on a computer such as Microsoft's free Reader application, or a book-sized computer THIS is used solely as a reading device such as Nuvomedia's Rocket eBook.) Users can purchase an eBook on diskette or CD, but the most popular method of getting an eBook is to purchase a downloadable file of the eBook (or other reading material) from a Web site (such as Barnes and Noble) to be read from the user's computer or reading device. Generally, an eBook can be downloaded in five minutes or less ......................................................................................................................... .............. Browse by Genre Available eBooks .............................................................................................................................. Art, Biography, Business, Chick Lit, Children's, Christian, Classics, Comics, Contemporary, Cookbooks, Manga, Memoir, Music, Mystery, Non Fiction, Paranormal, Philosophy, Poetry, Psychology, Religion, Romance, Science, Science Fiction, Self Help, Suspense, Spirituality, Sports, Thriller, Travel, Young Adult, Crime, Ebooks, Fantasy, Fiction, Graphic Novels, Historical Fiction, History, Horror, Humor And Comedy, ......................................................................................................................... ......................................................................................................................... .....BEST SELLER FOR EBOOK RECOMMEND............................................................. ......................................................................................................................... Blowout: Corrupted Democracy, Rogue State Russia, and the Richest, Most Destructive Industry on Earth,-- The Ride of a Lifetime: Lessons Learned from 15 Years as CEO of the Walt Disney Company,-- Call Sign Chaos: Learning to Lead,-- StrengthsFinder 2.0,-- Stillness Is the Key,-- She Said: Breaking the Sexual Harassment Story THIS Helped Ignite a Movement,-- Atomic Habits: An Easy & Proven Way to Build Good Habits & Break Bad Ones,-- Everything Is Figureoutable,-- What It Takes: Lessons in the Pursuit of Excellence,-- Rich Dad Poor Dad: What the Rich Teach Their Kids About Money THIS the Poor and Middle Class Do Not!,-- The Total Money Makeover: Classic Edition: A Proven Plan for Financial Fitness,-- Shut Up and Listen!: Hard Business Truths THIS Will Help You Succeed, ......................................................................................................................... .........................................................................................................................
       Reply 
    Are you sure you want to  Yes  No
    Your message goes here

WordCamp Lyon 2015 - WordPress, Git et l'intégration continue

  1. 1. WORDPRESS, GIT ET L'INTÉGRATION CONTINUE Retour d'expérience et outils... WordCamp Lyon / 5 juin 2015
  2. 2. QUI SUIS-JE ? CONSULTANT TECHNIQUE WEB Développements spécifiques, création de site, constitution d'équipes, accompagnement, méthodes agiles... Mon crédo, si c'est technique et web, ça m'intéresse      http://chstudio.fr s.hulard@chstudio.fr     @s_hulard http://github.com/shulard
  3. 3. PENDANT CETTE SESSION... 1. L'intégration continue 2. Avec WordPress 3. Méthodes et outils
  4. 4. L'INTÉGRATION CONTINUE
  5. 5. QU'EST-CE QUE C'EST ? Continuous Integration is a software development practice where members of a team integrate their work frequently, usually each person integrates at least daily - leading to multiple integrations per day. Each integration is verified by an automated build (including test) to detect integration errors as quickly as possible. Many teams find that this approach leads to significantly reduced integration problems and allows a team to develop cohesive software more rapidly. Martin Flower
  6. 6. À QUOI ÇA SERT ? Se rendre compte de ses erreurs automatiquement Avoir accès aux derniers développements Suivre l'évolution du travail en cours
  7. 7. BÉNÉFICES Fiabilisation des développements Automatisation des tâches récurentes Gain de temps
  8. 8. POUR QUI ? Les grandes équipes Les utilisateurs des méthodes agiles Les gros projets Mais pas que...
  9. 9. AVEC WORDPRESS
  10. 10. VRAIMENT, MAIS POURQUOI ? J'entends tout le temps : WordPress c'est juste pour faire des blogs ! WordPress c'est mal codé ! WordPress c'est pas fait pour les devs ! Alors, pourquoi autant de sites l'utilisent ?
  11. 11. IL A SES AVANTAGES Utilisé sur plus de 23% des sites web Une interface claire, et très intuitive Facile à mettre en place Très bien documenté Une importante communauté Une modularité incroyable
  12. 12. C'EST SEULEMENT UN OUTIL ! Il faut le comprendre, le connaitre... S'il n'est pas adapté, il faut en choisir un autre...
  13. 13. QUELLES CONTRAINTES ? Différents environnements avec différentes configurations : Développement en local, ici tout et possible! Production sur serveur client (mutualisé, dédié, ...) on ne maitrise rien ici... Un cycle de vie des données (BDD, images) à gérer !
  14. 14. MÉTHODES ET OUTILS
  15. 15. LE CONTRÔLE DE VERSION Sécurisation du code et historique des modifications : Git - (mon préféré) Subversion - https://git-scm.com/ https://subversion.apache.org/
  16. 16. L'AUTOMATISATION Initialisation du fichier wp-config.php Initialisation de la base de données Sauvegarde / Restauration des contenus (images et BDD) Gestion des différents environnements (dev, préprod, prod) Objectif: Simplifier les tâches critiques et automatiser !
  17. 17. DES BESOINS COMPLIQUÉS ... Versionning, tag, branches Imports SQL en ligne de commande RSync: Synchronisation de fichiers vers un serveur distant par SSH Validation du code (PHPLint, Behat/Mink, PHPUnit...)
  18. 18. ... MAIS DES SOLUTIONS EXISTENT Beaucoup se sont posés la question, leur expérience est précieuse ! Des outils sont capables de manipuler : Un environnement PHP Git / SVN MySQL Configuration du serveur web
  19. 19. UN MODÈLE DE PROJET Création d'un projet type pour l'intégration WordPress : Une structure duplicable très rapidement Versionné sous Git et dispo sur GitHub   https://github.com/CHStudio/wordpress-project 1
  20. 20. LA COMMANDE EST MON AMIE La plupart des outils s'utilisent en ligne de commande. Il faut apprendre à dompter le terminal, Bash, SSHpour qu'ils deviennent des alliés.
  21. 21. PHING est un système de build basé sur : Un fichier XML décrit les tâches 1 1. Phing Apache Ant <project basedir="." default="help"> <target name="env:install" description="Install current environment"> <phingcall target="env:init"></phingcall> <phingcall target="wp:install"></phingcall> </target> <target name="env:wp:update" description="Update local wordpress version instance to the most recent one"> <exec command="cd public/wp-cms && git fetch --tags && git checkout `git tag | tail -1`"></exec> </target> <target name="env:backup" description="Restore backuped date in the current environement"> <phingcall target="db:backup"></phingcall> <phingcall target="wp:uploads:backup"></phingcall> </target> </project> https://github.com/CHStudio/wordpress-project/blob/develop/build.xml
  22. 22. WP-CLI est une série de commandes pour gérer les installations WordPress : Ajout d'utilisateurs, gestion des droits Gestion de termes, des posts, des thèmes, des sidebars... Tout ça en ligne de commande  WP-CLI $ bin/wp export $ bin/wp is-installed $ bin/wp install --url="http://monsite.com" --title="un super site !" $ bin/wp post create $ bin/wp rewrite list
  23. 23. COMBINÉS POUR SIMPLIFIER $ phing env:init -> Générer la configuration $ phing env:install -> Initialser configuration et BDD $ phing db:backup -> Créer un dump de la BDD au format SQL $ phing wp:uploads:restore -> Restaurer une archive des images $ phing sync:execute -> Synchroniser un environnement distant
  24. 24. DÉPENDANCES AVEC COMPOSER Quels outils sont utiles au projet ? { "name": "chstudio/wordpress-project", "description": "A sample initialization project for WordPress website", "license": "Apache-2.0", "authors": [ { "name": "Stephane HULARD", "email": "s.hulard@chstudio.fr" } ], "config": { "bin-dir": "bin" }, "require": {}, "require-dev": { "phing/phing": "2.*", "wp-cli/wp-cli": "0.*" } }
  25. 25. INSTALLATION AVEC COMPOSER Une commande pour les trouver ! Une commande pour les amener tous ! Et dans un projet les lier...  Le fichier composer.lockdoit être versionné! # En local $ composer install # En production $ composer install --no-dev --optimize-autoloader --prefer-dist --no-interaction
  26. 26. GIT BRANCHING MODEL Structurer et normaliser le flux de développement avec git: Développement Releases Production Maintenance Git Flow
  27. 27. ET HOP DANS LE CLOUD ! pour gérer les dépôts, gratuit et avec la possibilité de créer des dépôts privés ! GitLab
  28. 28. GITLAB Des dépôts centralisés et accessibles en HTTP / SSH Installation simplifiée et accès sécurisé par clé SSH Gestion des tickets Sauvegarde du code source des projets  Récupérer les sources et installer le projet : $ git clone $ composer install --no-dev --optimize-autoloader --prefer-dist --no-interaction $ bin/phing env:install --Dbuild.env=PROD $ bin/phing db:restore --Dbuild.env=PROD $ bin/phing wp:uploads:restore --Dbuild.env=PROD $ bin/phing wp:migrate --Ddomain.previous=http://monsite.dev --Ddomain.previous=http://monsite.com
  29. 29. GITLAB CI Plateforme d'intégration continue gratuite avec Un buildest généré pour chaque commit sur le projet GitLab
  30. 30. GITLAB CI: UN BUILD ? Un build est une série d'étapes totalement automatisées, qui seront exécutées sur chaque commit. Il permet de faire tout ce qui est nécessaire : Tests unitaires et fonctionnels Validation du code (PHP CodeSnifferpar exemple) Déploiement automatique en cas de succès  Le projet devient autonome...
  31. 31. GITLAB CI: LISTE DES BUILDS Visualisation de l'état de chaque commit Accès aux statistiques sur le projet
  32. 32. GITLAB CI: LOG D'UN BUILD Visualisation du retour d'exécution des commandes Utile pour savoir d'où viennent les soucis
  33. 33. UN COUPLE EFFICACE L'intégration native entre les deux plateformes simplifie fortement l'installation... Les builds peuvent être exécutés n'importe où : Aucune nécessité d'avoir un serveur Lancement en local très simple
  34. 34. D'AUTRES SOLUTIONS EXISTENT Jenkins: PHPCI: Travis CI: ... Avec de nouvelles contraintes et possibilités ! http://jenkins-ci.org/ https://www.phptesting.org/ https://travis-ci.org/
  35. 35. MERCI POUR VOTRE ATTENTION ! DES QUESTIONS ? http://shulard.github.io/slides/wordcamp-lyon-2015

×