Share
Embed
Giannis Economou - On deployment - User the command line Luke
WordPress Greek Community PRO
July 04, 2018
Transcript
17 slides
-
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 -
DEPLOYMENT ALL OF THE ACTIVITIES THAT MAKE A SOFTWARE SYSTEM
AVAILABLE FOR USE -
DEPLOYΜΕΝΤ ENVIRONMENTS ΠΕΡΙΒΑΛΛΟΝ - ENVIRONMENT Staging QA Testing Development (συχνά
localhost) (πολλά) Production (live) (immutable!) -
~ 75% ΧΡΗΣΙΜΟΠΟΙΟΥΝ ENVIRONMENTS ______________________________ ~ ΑΛΛΑ 75% ΕΧΟΥΝ ΕΠΕΜΒΕΙ
ΣΤΟ PRODUCTION (COWBOY CODING) smashingmagazine.com wordpress-deployment-survey COWBOY CODING! -
ON DEPLOYMENT - USE THE COMMAND LINE, LUKE! ΑΥΤΟΜΑΤΟΠΟΙΗΣΗ -
ΚΑΘΙΕΡΩΜΕΝΟ TOOL STACK ▸ Command Line Tools => Scriptable => Αυτοματισμοί στο deployment ▸ Αυτοματισμοί => Εύκολο, σωστό deploy => Συχνό Deploy -
WORDPRESS COMMAND LINE TOOL WP-CLI TOOL ▸ command line (scripting/automation)
▸ πχ. install, export / import, search and replace, user management, posts κ.α. ▸ speed & features ▸ extendable! -
GIT OR ANY VERSION CONTROL SYSTEM GIT ▸ ή άλλο
VCS (hg, svn) ▸ command line/scripting/automation ▸ ταυτόχρονα πολλοί developers στα ίδια αρχεία ▸ ποιός άλλαξε τί και πότε; ▸ history & rollback ▸ θέλουμε τον δικό μας κώδικα versioned: ▸ όχι όλο το WordPress core! ▸ όχι plugins τρίτων! ▸ όχι configuration! -
DOTENV DOTENV ▸ Standard: node.js, Python, Ruby, PHP, Rust, Perl,
… παντού ▸ Store configuration in the environment, separate from code ▸ .env αρχείο => environment variables -
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/ -
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 -
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/ -
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 … -
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