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.
2 October 26, 2015
San Francisco, CA
Janine
Fiona
that’s me
Leo
Continuous Development
Continuous Delivery
Continuous Integration
Continuous Deployment
Continuous Monitoring
Continuous
J...
plan
code
build
test
deploy
operate
http://kirbiecravings.com/2014/08/blueberry-mug-cake-2.html
code
CMS
Magento
Solr
ERP
Project
Applications
MMagento
117
Magento
118
Magento
119
Builds
Release
Staging
Magento
72
Magento
103
Magento
119
Magento
72
Magento
103
Magento
119
Magento
72
Magento
103
Magento
119
Environme...
StagingIntegrationDevbox ProductionDeploy
transient,
potentially broken
StagingIntegrationDevbox ProductionDeploy
VirtualBox
+ Vagrant
Jenkins
Server
identical
setup
One size doesn’t fit all!
What is it?
A simple shell script. That’s it!
No Ant, no Phing, no fancy PHP tool/framework
Where is it used?
In the build...
What is it?
A couple of chef cookbooks.
Run by AWS OpsWorks or Vagrant,…
Where is it used?
On the target servers
What does...
What is it?
A simple shell script.
Or the “deploy” chef cookbook
Or EasyDeployWorkflows
Where is it used?
On the target se...
What is it?
A simple shell script.
Sometimes triggered inside “deploy” before_migrate.rb
Where is it used?
On the target s...
doesn’t know anything about
the app, except where to get it
from and where to put it
knows how to get
the app up and
runni...
no creating
CMS blocks
no creating
product attributes
no updating of any
configuration settings!
no clearing
the cache
no ...
media directory
(sometimes
minified)
Database dump
(Vanilla)
Magento core
Modules
Scripts
Settings
Tools
Structure
Project
project web
root root
This is the complete
project
This is where your
webserver points to.
project web
root root
htdocs
<Name>
<theme>
layout
template
code
design
core
community
local
<area>
<Namespace>
<package>
app
htdocs
<Name>
<theme>
layout
template
code
design
etc
locale
<area>
core
community
local
<area>
<language>
modules
<packag...
htdocs
Module
default
layout
template
code
design
etc
locale
local
frontend
de_DE
modules
My
base
*.xml
app
My_Module2.xml...
by @colinmollenhour
htdocs
code
core
community
local
app
app/code/…/My/Module
.modman
My_Module
app/design/…
skin/frontend/…
app/etc/modules/M...
Vanilla
Magento
absolutely no
core hacks!
…and core bugs
you’ve fixed
(and submitted to
Magento, of course…)
(except offic...
modman “connects” existing modules to the Magento core,
but how do we manage them?
htdocs
code
core
community
local
app
app/code/…/My/Module
.modman
My_Module
app/design/…
skin/frontend/…
app/etc/modules/M...
“inspired” by
composer/installers
handles package types
<?php
namespace AoepeopleComposerInstallers;
class MagentoInstaller extends BaseInstaller
{
protected $locations = array(
...
• Fully compatible with magento-hackathon/magento-composer-installer
• Adds support for type “magento-source”
• Only puts ...
{
"minimum-stability":"dev",
"require":{
"aoepeople/composer-installers": "*",
"fbrnc/aoe_scheduler": "*",
"fbrnc/aoe_cach...
Webroot:
/var/www/<projectName>/<environmentName>/current/htdocs
var
var
<projectName>
releases
<environmentName>
shared
w...
https://github.com/AOEpeople/Magento_Boilerplate
discover use
code
review
add
modman
add
composer
git integrate test
deploy
download
good luck
with that!
pay $xx
to author...
Code Quality
Modules
Not enterprise
ready
Not production
ready
Not cloud ready Bad performance
Security
Urls
Database
Settings
Payment Provider
Configuration Feature
Flags…
Everything that’s
different between two
environments
Zettr
Every file is a potential
security risk
Don’t deploy anything
you don’t need to
operate the website
.git*
./htdocs/includes
./htdocs/downloader
./htdocs/pkginfo
./htdocs/LICENSE*
./htdocs/RELEASE_NOTES.txt
./htdocs/phpunit...
production,
staging,…
devbox and integration
environment
Vagrant
Boxes
Awesome
stuff
Every single
line potentially
can break
production!
Bratwurst
(Germans)
Donut
(Americans)
Pizza
(Italians)
master
Feature B
Feature A
Hotfix
(if master is not modified)
Hotfix
(if master is modified)
Feature C
build
install on
in...
Version Control
GIT, SVN,…
PHP lint
Version Control Code Reviews
Crucible,…
Version
Control
Code
Reviews
Build
Files
DB
Installer
Settings
Build
Files
ler
Settings
Static Code
Analysis
CodeSniffer
php-pmd
php-cpd
php-depend
Static Code
Analysis
Install on
“Integration”
First system where
code from all
developers/teams
meets each other
unstable ...
Install on
“Integration”
Unit Tests
PHPUnit
Unit Tests Integration Tests
AOE PMD
(for Magento)
broken links,
HTTP headers,
W3C validity,…
Test features that rely on o...
Integration Tests Acceptance Tests
Selenium
Firefox
Chrome
browser
size
640
980
1280
1900
US
languagesUK DE FRIT
language
size
browser
touchstone job
Acceptance Tests
Install on
“Staging”
Behat,
PDIFF,…
Same setup as production,
but different machines
Client QA /
approval
Install on
“Staging”
Stress
Tests
JMeter
Spin up EC2
instances to
produce traffic
Again:
multiple servers or
autoscaling setup
Stress
Tests
Install on
“Production”
A/B
Deployments
on different
scales
Plan...
Stress
Tests
Install on
“Production”
Deployment !=
Feature Release
Install on
“Production”
Enable Features
Version
Control
Code Reviews Build Static Code
Analysis
Install on
“Integration”
Unit Tests Integration
Tests
Acceptance
T...
Pipeline Visualization
#284
#283
#282
#281
#280
Build
Static Code
Analysis
Unit
Tests
Install on
“Integration”
Integration...
type “YESIKNOWWHATIMDOING” + click
automatically
http://joind.in/talk/view/15588
Follow me on twitter!
My blog
Rock-solid Magento Development and Deployment Workflows
Rock-solid Magento Development and Deployment Workflows
Rock-solid Magento Development and Deployment Workflows
Rock-solid Magento Development and Deployment Workflows
Rock-solid Magento Development and Deployment Workflows
Rock-solid Magento Development and Deployment Workflows
Rock-solid Magento Development and Deployment Workflows
Rock-solid Magento Development and Deployment Workflows
Rock-solid Magento Development and Deployment Workflows
Rock-solid Magento Development and Deployment Workflows
Rock-solid Magento Development and Deployment Workflows
Rock-solid Magento Development and Deployment Workflows
Rock-solid Magento Development and Deployment Workflows
Upcoming SlideShare
Loading in …5
×

Rock-solid Magento Development and Deployment Workflows

9,416 views

Published on

ZendCon 2015 - Las Vegas

Published in: Technology

Rock-solid Magento Development and Deployment Workflows

  1. 1. 2 October 26, 2015
  2. 2. San Francisco, CA Janine Fiona that’s me Leo
  3. 3. Continuous Development Continuous Delivery Continuous Integration Continuous Deployment Continuous Monitoring Continuous Jenkins Everything sounds better with “continuous”
  4. 4. plan code build test deploy operate
  5. 5. http://kirbiecravings.com/2014/08/blueberry-mug-cake-2.html
  6. 6. code
  7. 7. CMS Magento Solr ERP Project Applications MMagento 117 Magento 118 Magento 119 Builds Release
  8. 8. Staging Magento 72 Magento 103 Magento 119 Magento 72 Magento 103 Magento 119 Magento 72 Magento 103 Magento 119 Environment Servers Instances
  9. 9. StagingIntegrationDevbox ProductionDeploy transient, potentially broken
  10. 10. StagingIntegrationDevbox ProductionDeploy VirtualBox + Vagrant Jenkins Server identical setup
  11. 11. One size doesn’t fit all!
  12. 12. What is it? A simple shell script. That’s it! No Ant, no Phing, no fancy PHP tool/framework Where is it used? In the build job of a Jenkins server What does it need to know? Where to get all the source code from What does it do? add metadata, composer, minify, packaging, upload to S3
  13. 13. What is it? A couple of chef cookbooks. Run by AWS OpsWorks or Vagrant,… Where is it used? On the target servers What does it need to know? The role of the server (web server, devbox, Redis,…) What does it do? Installing and configuring web server, PHP, MySQL, Redis,…
  14. 14. What is it? A simple shell script. Or the “deploy” chef cookbook Or EasyDeployWorkflows Where is it used? On the target servers What does it need to know? How to get the build and where to deploy it to What does it do? (Resetting the environment), getting the build, extracting it, managing release folders and symlinks, triggering installer, cleanup old releases
  15. 15. What is it? A simple shell script. Sometimes triggered inside “deploy” before_migrate.rb Where is it used? On the target servers, called from deployment step What does it need to know? What environment this is. Injected settings What does it do? Run modman, apply settings, trigger update scripts, customize cache prefix, indexing,…
  16. 16. doesn’t know anything about the app, except where to get it from and where to put it knows how to get the app up and running
  17. 17. no creating CMS blocks no creating product attributes no updating of any configuration settings! no clearing the cache no purging CDN or Reverse Proxy content!
  18. 18. media directory (sometimes minified) Database dump (Vanilla) Magento core Modules Scripts Settings Tools
  19. 19. Structure Project
  20. 20. project web root root This is the complete project This is where your webserver points to.
  21. 21. project web root root
  22. 22. htdocs <Name> <theme> layout template code design core community local <area> <Namespace> <package> app
  23. 23. htdocs <Name> <theme> layout template code design etc locale <area> core community local <area> <language> modules <package> <Namespace> <package> *.xml *.csv <theme> app skin lib Module2 default layout template code design etc locale frontend local frontend de_DE modules base My base My_Module2.xml My_Module2.csv default app skin etc, Block, … js, css, img, … my_module2 my_module2 Magento My_Module My_Module2 Module default layout template code design etc locale frontend local frontend de_DE modules base My base My_Module.xml My_Module.csv default app skin etc, Block, … js, css, img, … my_module my_module
  24. 24. htdocs Module default layout template code design etc locale local frontend de_DE modules My base *.xml app My_Module2.xml My_Module2.csv my_module2 My_Module.xml My_Module.csv etc, Block, … my_module Module2 etc, Block, … my_module2 my_module
  25. 25. by @colinmollenhour
  26. 26. htdocs code core community local app app/code/…/My/Module .modman My_Module app/design/… skin/frontend/… app/etc/modules/My_Module.xml modman app/code/…/My/Module My_Module2 app/design/… skin/frontend/… app/etc/modules/My_Module.xml modman <theme> layout template design etc locale <area> <language> modules <package> *.xml modman doesn’t even need to be in the web root!
  27. 27. Vanilla Magento absolutely no core hacks! …and core bugs you’ve fixed (and submitted to Magento, of course…) (except official patches)
  28. 28. modman “connects” existing modules to the Magento core, but how do we manage them?
  29. 29. htdocs code core community local app app/code/…/My/Module .modman My_Module app/design/… skin/frontend/… app/etc/modules/My_Module.xml modman app/code/…/My/Module My_Module2 app/design/… skin/frontend/… app/etc/modules/My_Module.xml modman <theme> layout template design etc locale <area> <language> modules <package> *.xml tools n98-magerun.phar phpunit.phar modman EnvSettingsTool composer.phar htdocs .modman Configuration Installer (Metadata, Doc,…) My_Module My_Module2 app,… and usually there’s even more stuff… These should come from different origins
  30. 30. “inspired” by composer/installers handles package types
  31. 31. <?php namespace AoepeopleComposerInstallers; class MagentoInstaller extends BaseInstaller { protected $locations = array( 'module' => '.modman/{$name}/', 'source' => 'htdocs/' ); }
  32. 32. • Fully compatible with magento-hackathon/magento-composer-installer • Adds support for type “magento-source” • Only puts packages into place • Native modman script is used to deploy modules • Wrapped in a simple installer script
  33. 33. { "minimum-stability":"dev", "require":{ "aoepeople/composer-installers": "*", "fbrnc/aoe_scheduler": "*", "fbrnc/aoe_cachecleaner": "*", "aoepeople/magento_enterprise": "1.13.1.0", "aoepeople/envsettingstool": "*" }, "config": { "bin-dir": "bin" } } replaces Hackathon Installer some modules Vanilla Magento Source Tools,…
  34. 34. Webroot: /var/www/<projectName>/<environmentName>/current/htdocs var var <projectName> releases <environmentName> shared www media build_117 build_118 build_119 .modman htdocs Configuration tools install.sh app,… var media previous latest current next My_Module My_Module2
  35. 35. https://github.com/AOEpeople/Magento_Boilerplate
  36. 36. discover use code review add modman add composer git integrate test deploy download good luck with that! pay $xx to author provide FTP access seriously?! one-click install upload “Step 1” upload “Step 2” clear caches
  37. 37. Code Quality Modules Not enterprise ready Not production ready Not cloud ready Bad performance Security
  38. 38. Urls Database Settings Payment Provider Configuration Feature Flags… Everything that’s different between two environments
  39. 39. Zettr
  40. 40. Every file is a potential security risk Don’t deploy anything you don’t need to operate the website
  41. 41. .git* ./htdocs/includes ./htdocs/downloader ./htdocs/pkginfo ./htdocs/LICENSE* ./htdocs/RELEASE_NOTES.txt ./htdocs/phpunit.xml* ./htdocs/*.sample ./htdocs/var ./htdocs/media ./.modman/Aoe_TemplateHints ./.modman/Aoe_Profiler ./.modman/EcomDev_PHPUnit …
  42. 42. production, staging,… devbox and integration environment
  43. 43. Vagrant Boxes
  44. 44. Awesome stuff Every single line potentially can break production! Bratwurst (Germans) Donut (Americans) Pizza (Italians)
  45. 45. master Feature B Feature A Hotfix (if master is not modified) Hotfix (if master is modified) Feature C build install on integration tests build install on integration tests install on deploy build install on integration tests deploy to stage deploy to prod build install on integration tests deploy to stage deploy to prod build install on integration tests deploy to stage deploy to prod single mainline no commits, only --no-ff merges
  46. 46. Version Control GIT, SVN,… PHP lint
  47. 47. Version Control Code Reviews Crucible,…
  48. 48. Version Control Code Reviews Build Files DB Installer Settings
  49. 49. Build Files ler Settings Static Code Analysis CodeSniffer php-pmd php-cpd php-depend
  50. 50. Static Code Analysis Install on “Integration” First system where code from all developers/teams meets each other unstable system, might be broken, will be rebuilt without warning
  51. 51. Install on “Integration” Unit Tests PHPUnit
  52. 52. Unit Tests Integration Tests AOE PMD (for Magento) broken links, HTTP headers, W3C validity,… Test features that rely on other parts (e.g. framework, external services,…) External components (SSL, Redis, Varnish, ERP, Data Import,…) Basically this is also PHPUnit, but addressing other things
  53. 53. Integration Tests Acceptance Tests Selenium
  54. 54. Firefox Chrome browser size 640 980 1280 1900 US languagesUK DE FRIT
  55. 55. language size browser touchstone job
  56. 56. Acceptance Tests Install on “Staging” Behat, PDIFF,… Same setup as production, but different machines Client QA / approval
  57. 57. Install on “Staging” Stress Tests JMeter Spin up EC2 instances to produce traffic
  58. 58. Again: multiple servers or autoscaling setup Stress Tests Install on “Production” A/B Deployments on different scales Plan B: rollback Zero Downtime
  59. 59. Stress Tests Install on “Production”
  60. 60. Deployment != Feature Release
  61. 61. Install on “Production” Enable Features
  62. 62. Version Control Code Reviews Build Static Code Analysis Install on “Integration” Unit Tests Integration Tests Acceptance Tests Install on “Staging” Install on “Production” Enable Features
  63. 63. Pipeline Visualization #284 #283 #282 #281 #280 Build Static Code Analysis Unit Tests Install on “Integration” Integration Tests Acceptance Tests #285 for team dashboards
  64. 64. type “YESIKNOWWHATIMDOING” + click automatically
  65. 65. http://joind.in/talk/view/15588
  66. 66. Follow me on twitter! My blog

×