Diese Präsentation wurde erfolgreich gemeldet.
Wir verwenden Ihre LinkedIn Profilangaben und Informationen zu Ihren Aktivitäten, um Anzeigen zu personalisieren und Ihnen relevantere Inhalte anzuzeigen. Sie können Ihre Anzeigeneinstellungen jederzeit ändern.

Magento 2 Workflows

3.470 Aufrufe

Veröffentlicht am

Tools, tips, and workflows for Magento 2.

Veröffentlicht in: Technologie
  • Als Erste(r) kommentieren

Magento 2 Workflows

  1. 1. Smooth M2 Workflows
  2. 2. • Challenges • Solutions • HelpfulTools • Recommendations • Q/A Agenda
  3. 3. My Story
  4. 4. The Process
  5. 5. Challenges • Scalable • Assumptions of Skill • Lynchpins
  6. 6. • Too Complicated • Not Automated • Too Many Assumptions • I Thought Others Would Care  Mistakes
  7. 7. • KISS • Guides,NotRules • OptimizeMercilessly • RightProcessForThe RightTeam • DrawYourLineIn The Sand Lessons Learned
  8. 8. • Keep Developer Freedom? • MaintainCode Integrity? • Keep Accountability? Developer Setup
  9. 9. • *nix(Unix / Linux)basedOS • All Extensionsmustmatchappropriate versions – PHP – Apache/ NGinX – MySQL – Etc… • TESTSMUST PASS! Developer Setup
  10. 10. • KeepTrack of ChangesEffectively? • Reduce Conflictsand Reconciliation? • Code Promotion? Code Management
  11. 11. • Git/ Github • GitBranching System Code Management
  12. 12. • WhatTools? • Scalability? • Non-versioned Assets? Code Promotion
  13. 13. Code Promotion • Deploybot • Git/ Github • Composer • M2 Command Line
  14. 14. • Vagrant • PHPStorm/ IDE • Composer • Git/ Github Tools
  15. 15. Vagrant • Simplify Developer Setup • Easily Distributed Environment • Flexible • Expandable (Docker/ AWS / etc.)
  16. 16. Vagrant • UsedSimple Vagrantfile and Shell Script • KeptFiles in Version Control • Allowed Simple DeveloperSetup $ ~/ git clonegit@github.com:username/repo.git $~/vagrantup
  17. 17. Vagrant Performance • If it doesn’t change,don’t mount it! • Increase CPUs and Memory for the Box • Symlink var/ directories to /tmp/magento/var/* • NFS mount (exceptvar/) • Consider Vmware • Consider Docker
  18. 18. Consider Building Your Own Box Vagrant
  19. 19. PHPStorm • Code Completion • Automated Code Sniffs • Integrated Testing • Xdebug Support • Code Templates
  20. 20. PHPStorm
  21. 21. • Complete URNs $ ~/ php bin/magento dev:urn-catalog:generate./misc.xml PHPStorm
  22. 22. PHPUnit Integration
  23. 23. • Mess Detector • ECG Standards • PSR Standards Code Sniffs
  24. 24. Code Sniffs
  25. 25. WorkFlow
  26. 26. Git Repository Structure {root} - Vagrantfile - ClientName/ - Module01/ - Module02/ - Module03/
  27. 27. Each moduleis packaged separately. This allows maximum flexibility. Git Repository Structure
  28. 28. $ ~/ git clonegit@github.com:company/clientrepo.git $ ~/ git checkout–b mybranch develop $ ~/vagrantup Developer WorkFlow
  29. 29. • Code is kept in separate repo • Maintainedand deployed in branches (dev, stage, prod, etc.) • Allows faster deployments and rollbacks • Client code is kept as artifacts on theserver. • Composer.json points to directorythat holds all artifacts. Deployment
  30. 30. $ ~/ git clone git@github.com:username/clientserverrepo.git $ ~/ git checkout -b<branchname> $ ~/ composercreate-project--repository-url=https://repo.magento.com/magento/project-community-edition ./ $ ~/ git commit –m “…” $ ~/ composerrequireclientname/module01clientname/module02(etc.) $ ~/ phpbin/magentodeploy:mode:set<mode> $ ~/ phpbin/magentomodule:enableClient_Module01Client_Module02 $ ~/ phpbin/magentosetup:upgrade $ ~/ git commit –m “…” Server Setup
  31. 31. $ ~/ git fetch –all $ ~/ git mergeorigin/stage $ ~/ php bin/magento setup:di:compile-multi-tenant $ ~/ git commit –m “…” $ ~/ git tag v1.0.10 $ ~/ (other misc…) Deployment
  32. 32. (onbranchproductioninrepo) $~/ gitfetch–all $~/ gitcheckout–b v1.0.10v1.0.10 $~/ phpbin/magentomodule:enable<module01><module02> $~/ phpbin/magentosetup:upgrade Production Deployment
  33. 33. Automation Git Hooks can automate deployment of code. Neverhook a production deployment! Deploybot can automate everything we’veseen as well as static asset generation, etc.
  34. 34. Email:ryan@coolryan.com Twitter: @ryanstreet Thank You

×