Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Giannis Economou - On deployment - User the command line Luke

Giannis Economou - On deployment - User the command line Luke

Transcript

  1. USE THE COMMAND LINE, LUKE! ON DEPLOYMENT ΓΙΑΝΝΗΣ ΟΙΚΟΝΟΜΟΥ https://gr.linkedin.com/in/gecon

    www.trustservers.gr, www.antithesis.gr Athens WordPress 15th Meetup July 2018
  2. DEPLOYMENT ALL OF THE ACTIVITIES THAT MAKE A SOFTWARE SYSTEM

    AVAILABLE FOR USE
  3. DEPLOYΜΕΝΤ ENVIRONMENTS ΠΕΡΙΒΑΛΛΟΝ - ENVIRONMENT Staging QA Testing Development (συχνά

    localhost) (πολλά) Production (live) (immutable!)
  4. ~ 75% ΧΡΗΣΙΜΟΠΟΙΟΥΝ ENVIRONMENTS ______________________________ ~ ΑΛΛΑ 75% ΕΧΟΥΝ ΕΠΕΜΒΕΙ

    ΣΤΟ PRODUCTION (COWBOY CODING) smashingmagazine.com wordpress-deployment-survey COWBOY CODING!
  5. ON DEPLOYMENT - USE THE COMMAND LINE, LUKE! ΑΥΤΟΜΑΤΟΠΟΙΗΣΗ -

    ΚΑΘΙΕΡΩΜΕΝΟ TOOL STACK ▸ Command Line Tools => Scriptable => Αυτοματισμοί στο deployment ▸ Αυτοματισμοί => Εύκολο, σωστό deploy => Συχνό Deploy
  6. WORDPRESS COMMAND LINE TOOL WP-CLI TOOL ▸ command line (scripting/automation)

    ▸ πχ. install, export / import, search and replace, user management, posts κ.α. ▸ speed & features ▸ extendable!
  7. GIT OR ANY VERSION CONTROL SYSTEM GIT ▸ ή άλλο

    VCS (hg, svn) ▸ command line/scripting/automation ▸ ταυτόχρονα πολλοί developers στα ίδια αρχεία ▸ ποιός άλλαξε τί και πότε; ▸ history & rollback ▸ θέλουμε τον δικό μας κώδικα versioned: ▸ όχι όλο το WordPress core! ▸ όχι plugins τρίτων! ▸ όχι configuration!
  8. DOTENV DOTENV ▸ Standard: node.js, Python, Ruby, PHP, Rust, Perl,

    … παντού ▸ Store configuration in the environment, separate from code ▸ .env αρχείο => environment variables
  9. THE MISSING DEPENDENCY MANAGER PHP COMPOSER ▸ PHP Dependency Manager

    ▸ command line only ▸ Καθιερωμένος ή ο μόνος τρόπος για πολλά PHP Projects: ▸ Drupal CMS, Magento Commerce, TYPO3 CMS ▸ Symfony PHP Framework (F/W), Laravel PHP F/W ▸ Zend, Codeigniter, CakePHP F/Ws ▸ PHP: https://packagist.org/
  10. THE MISSING DEPENDENCY MANAGER WORDPRESS ON COMPOSER

  11. THE MISSING DEPENDENCY MANAGER WORDPRESS ON COMPOSER - WPACKAGIST.ORG

  12. THE MISSING DEPENDENCY MANAGER DEPENDENCY? MANAGER? ▸ Το Project μας

    χρησιμοποιεί κώδικα που έχουν γράψει άλλοι => Dependencies (εξαρτήσεις)! ▸ WordPress is a dependency! ▸ Με τον composer: dependencies σε “state” file. ▸ Στο git μόνο το “state” file, όχι ο κώδικας τρίτων. ▸ Versioned state! Apply state! Rollbacks! Apply on any environment! composer.json
  13. WORDPRESS BEDROCK BOILDERPLATE MEET BEDROCK … ▸ Open Source project

    ▸ Ενεργό Community
 _______________________________ ▸ Composer ▸ Separate, isolated configs per environment ▸ .env support
 ________________________________ ▸ Modern folder structure ▸ Requires: PHP 5.6+ ▸ Secure passwords ▸ https://roots.io/bedrock/
  14. ΣΤΗΝ ΠΡΑΞΗ ΑΣ ΤΑ ΔΟΥΜΕ ΚΑΙ…

  15. WINDOWS SUBSYSTEM FOR LINUX: ”PRIMARILY A TOOL FOR DEVELOPERS –

    ESPECIALLY WEB DEVELOPERS AND THOSE WHO WORK ON OR WITH OPEN SOURCE PROJECTS". MICROSOFT WSL FAQ - 2016 MICROSOFT WINDOWS? HERE YOU GO …
  16. SELECTED LINKS INTERESTING READ ▸ https://roots.io/guides/using-wp-cli-aliases/ ▸ https://www.alainschlesser.com/attracting-developers-wordpress/ ▸ https://core.trac.wordpress.org/ticket/21022

    ▸ https://roots.io/twelve-factor-wordpress/ ▸ https://www.phptherightway.com/ ▸ database: https://github.com/wp-sync-db/wp-sync-db, https:// versionpress.net/, https://dbv.vizuina.com/, https://github.com/ mattes/wp-cli-git-command
  17. THANK YOU!