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.
© 2016 Magento, Inc. Page | 1
© 2016 Magento, Inc. Page | 2
Agenda
1. Deployment types
2. File permissions
3. Connecting to Marketplace
4. Upgrading pro...
© 2016 Magento, Inc. Page | 3
Deployment Types
© 2016 Magento, Inc. Page | 4
Deployment Types
Development DeploymentProduction Deployment
Requirements:
- Secure
- Reliab...
© 2016 Magento, Inc. Page | 5
Deployment Types
Extension
Contributing
Self-hosted
Cloud
Shared hosting
Development Deploym...
© 2016 Magento, Inc. Page | 6
Source of the Code
• Composer
• Git
• Archives
• Ready VM boxes:
– Vagrant
– Docker
Contribu...
© 2016 Magento, Inc. Page | 7
Application Modes
developer
• Errors displayed
• Auto-generated
static files
production
• Er...
© 2016 Magento, Inc. Page | 8
File permissions
© 2016 Magento, Inc. Page | 9
File Permissions
• Single user
– A single user for both command line and web
– Less flexibil...
© 2016 Magento, Inc. Page | 10
Two Users Setup
• Command line user is the owner of the files and has full/extended
permiss...
© 2016 Magento, Inc. Page | 11
Magento Application: Read-Only Paths
• /
• app
• bin
• devlib
• phpserver
• pub
• pub/error...
© 2016 Magento, Inc. Page | 12
Magento Application: Writeable Paths
• pub/media
• app/etc/env.php – for cache status manag...
© 2016 Magento, Inc. Page | 13
Connecting to Marketplace
© 2016 Magento, Inc. Page | 14
Marketplace Credentials
• Marketplace keys ≠ marketplace username and password
© 2016 Magento, Inc. Page | 15
Marketplace Keys Location
• Two places where the keys are stored:
– If you run Composer com...
© 2016 Magento, Inc. Page | 16
Upgrading Procedure
© 2016 Magento, Inc. Page | 17
Composer-based Upgrade (Command Line)
• magento maintenance:enable
• composer require magen...
© 2016 Magento, Inc. Page | 18
Git-based Upgrade (Command Line)
Assumption: you are a contributing developer
• git fetch m...
© 2016 Magento, Inc. Page | 19
Upgrade via Web Setup Wizard
• Admin Panel > System > Tools > Setup Wizard
• Select “System...
© 2016 Magento, Inc. Page | 20
Upgrading Production: Steps
On Staging
1. Upgrade the code
2. Clean generated files
3. Upgr...
© 2016 Magento, Inc. Page | 21
Proper Way to Generate Files on Staging
• Configure same set of enabled/disabled modules as...
© 2016 Magento, Inc. Page | 22
Olga Kopylova
Q&A
Upcoming SlideShare
Loading in …5
×

Mage Titans USA 2016 M2 deployment

3,777 views

Published on

Depending on your goal, you might deploy Magento application differently. It may be a deployment on development environment: for an extension developer or for a contributor. It may be production environment: this may have a lot of variations, as each project is different. Depending on your case, you should now some Magento specifics that would help you avoid common mistakes leading to inefficient or broken deployment. In this session, I’ll focus on such details with relation to each type of the deployment process.

Published in: Technology
  • Be the first to comment

Mage Titans USA 2016 M2 deployment

  1. 1. © 2016 Magento, Inc. Page | 1
  2. 2. © 2016 Magento, Inc. Page | 2 Agenda 1. Deployment types 2. File permissions 3. Connecting to Marketplace 4. Upgrading procedure 5. Q&A
  3. 3. © 2016 Magento, Inc. Page | 3 Deployment Types
  4. 4. © 2016 Magento, Inc. Page | 4 Deployment Types Development DeploymentProduction Deployment Requirements: - Secure - Reliability - Performance - Flexible deployment settings Requirements: - Easy to deploy - Developer tools & debugging
  5. 5. © 2016 Magento, Inc. Page | 5 Deployment Types Extension Contributing Self-hosted Cloud Shared hosting Development DeploymentProduction Deployment
  6. 6. © 2016 Magento, Inc. Page | 6 Source of the Code • Composer • Git • Archives • Ready VM boxes: – Vagrant – Docker Contributing dev Extension dev Production Production
  7. 7. © 2016 Magento, Inc. Page | 7 Application Modes developer • Errors displayed • Auto-generated static files production • Errors logged • Pre-generated static files default • A simplified “production” • Errors logged • Auto-generated static files For development For production
  8. 8. © 2016 Magento, Inc. Page | 8 File permissions
  9. 9. © 2016 Magento, Inc. Page | 9 File Permissions • Single user – A single user for both command line and web – Less flexibility for permissions management – Simplified setup – Good for development – May be the only option for shared hosting • Two users: a web user and a command line user – Better flexibility for permissions management – More complicated setup – Good for production Production on shared hostingDevelopment Production
  10. 10. © 2016 Magento, Inc. Page | 10 Two Users Setup • Command line user is the owner of the files and has full/extended permissions – Run Magento console commands and Cron from this user • Web user is in the same group and has limited permissions – Run web server from this user • Both users are in the same primary group drwxr-xr-x 15 olga www-data 646 Aug 30 19:16 app Command line Web user
  11. 11. © 2016 Magento, Inc. Page | 11 Magento Application: Read-Only Paths • / • app • bin • devlib • phpserver • pub • pub/errors • pub/static • setup • update • var/di • var/generation • vendor
  12. 12. © 2016 Magento, Inc. Page | 12 Magento Application: Writeable Paths • pub/media • app/etc/env.php – for cache status management • var/cache • var/page_cache • var/log • var/report • var/session • pub/static/merged – for static files merging • var/view_preprocessed – for static files merging • pub/opt/magento/var/resource_config.json - for DB media storage • var/composer_home – for Setup Wizard
  13. 13. © 2016 Magento, Inc. Page | 13 Connecting to Marketplace
  14. 14. © 2016 Magento, Inc. Page | 14 Marketplace Credentials • Marketplace keys ≠ marketplace username and password
  15. 15. © 2016 Magento, Inc. Page | 15 Marketplace Keys Location • Two places where the keys are stored: – If you run Composer commands – Composer dir in user home folder (/home/olga/.composer/auth.json) – If you use Setup Wizard – Composer dir in Magento folder (/var/www/magento/var/composer_home/auth.json)
  16. 16. © 2016 Magento, Inc. Page | 16 Upgrading Procedure
  17. 17. © 2016 Magento, Inc. Page | 17 Composer-based Upgrade (Command Line) • magento maintenance:enable • composer require magento/product-community-edition 2.1.1 --no-update • composer update • magento setup:upgrade • Generate DI and static view files: – magento setup:di:compile – magento setup:static-content:deploy • magento maintenance:disable
  18. 18. © 2016 Magento, Inc. Page | 18 Git-based Upgrade (Command Line) Assumption: you are a contributing developer • git fetch magento • git merge magento/develop • composer install • magento setup:upgrade
  19. 19. © 2016 Magento, Inc. Page | 19 Upgrade via Web Setup Wizard • Admin Panel > System > Tools > Setup Wizard • Select “System Upgrade” • Select version • Optional: select other components to upgrade – Some components may require the upgrade to remain compatible with the new Magento version • Go through the steps
  20. 20. © 2016 Magento, Inc. Page | 20 Upgrading Production: Steps On Staging 1. Upgrade the code 2. Clean generated files 3. Upgrade DB 4. Generate DI 5. Generate static view files If you are an extension developer, reduce your extension’s upgrade time. Optimize setup scripts: - Implement one-step upgrade through multiple versions - Validate upgrade scripts on big DB On Production 1. Enable maintenance mode 2. Fetch updated code 3. Upgrade DB with --keep- generated 4. Disable maintenance mode
  21. 21. © 2016 Magento, Inc. Page | 21 Proper Way to Generate Files on Staging • Configure same set of enabled/disabled modules as on production – For both DI and static view files • Static view files: – Install Magento on the same code on staging – Locales: • setup staging store with the same languages • or specify languages used on production – Use --theme option to speed-up the process
  22. 22. © 2016 Magento, Inc. Page | 22 Olga Kopylova Q&A

×