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

More Decks by WordPress Greek Community

Other Decks in Programming

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. ~ 75% ΧΡΗΣΙΜΟΠΟΙΟΥΝ ENVIRONMENTS ______________________________ ~ ΑΛΛΑ 75% ΕΧΟΥΝ ΕΠΕΜΒΕΙ

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

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

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

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

    … παντού ▸ Store configuration in the environment, separate from code ▸ .env αρχείο => environment variables
  7. 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/
  8. 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
  9. 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/
  10. 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 …
  11. 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