Save 37% off PRO during our Black Friday Sale! »

Deploying TYPO3 Neos websites using Surf

Deploying TYPO3 Neos websites using Surf

Presentation given at T3CON NA in San Francisco.

Ecfb276920529fc9b924ad4a0877d9ce?s=128

Karsten Dambekalns

May 31, 2013
Tweet

Transcript

  1. TYPO3 Neos Deployment with

  2. Karsten Dambekalns karsten.dambekalns.de Your Speaker

  3. Your Speaker TYPO3 Neos and Flow developer 35 years old

    lives in Lübeck, Germany 1 wife, 3 sons 1 espresso machine likes canoeing & climbing
  4. What is deployment ?

  5. Software deployment is all of the activities that make a

    software system available for use. Wikipedia
  6. How to deploy your site ?

  7. Manual Deployment

  8. Manual deployment # ssh testuser@my-staging-server.example.com user123 $ cd /var/www/project user123

    $ git pull --rebase user123 $ git submodule init user123 $ git submodule update user123 $ rm -rf Data/Temporary/Production user123 $ ./flow3 doctrine:migrate user123 $ ./flow3 cache:warmup # ssh user123@my-live-server1.example.com user123 $ cd /home/myproject/public_html user123 $ git pull --rebase user123 $ git submodule init user123 $ git submodule update user123 $ rm -rf Data/Temporary/Production user123 $ ./flow3 doctrine:migrate user123 $ ./flow3 cache:warmup # ssh user123@my-live-server2.example.com user123 $ cd /home/myproject/public_html user123 $ git pull --rebase user123 $ git submodule init user123 $ git submodule update user123 $ rm -rf Data/Temporary/Production user123 $ ./flow3 doctrine:migrate user123 $ ./flow3 cache:warmup Lot of work Error prone
  9. Automated Deployment

  10. Possible solutions PHP? Bash Script Phing Script Capistrano Ant Script

    ...
  11. Environments Live Staging Integration Load-Testing Development Development

  12. Requirements Multiple Environments Rollback Extensibility Clustering Smoke Tests ...

  13. Meet

  14. Where‘s the wave Continuous Integration Infrastructure Surf Development

  15. Ride the wave Code Assets Configuration Content Your website Your

    Server Surf Deployment SSH Git Repository
  16. A simple deployment Build/Surf/planetflow3.php <?php $workflow = new \TYPO3\Surf\Domain\Model\SimpleWorkflow(); $deployment->setWorkflow($workflow);

    $application = new \TYPO3\Surf\Application\FLOW3(); $application->setDeploymentPath('/var/www/planetflow3-Integration'); $application->setOption('repositoryUrl', 'git://github.com/chlu/Planetflow3-Distribution.git'); $node = new \TYPO3\Surf\Domain\Model\Node('integration-server'); $node->setHostname('planetflow3-integration.example.com'); $application->addNode($node);
  17. Running the deployment

  18. Surf Architecture Flow Surf Packages Your package Standalone or Included

  19. The Surf Model Server Node Code / Assets Application Node

    Deployment Environments Deployment Work ow
  20. Work ow initialize update migrate finalize test switch cleanup Create

    release structure Code update (e.g. Git) Migration (e.g. Doctrine) Finalize release (cache warmup) Test release (smoke test) Publish release to live state Cleanup old releases Stages
  21. Tasks initialize update Work ow Base Application migrate switch cleanup

    ... Create Directories Create Symlinks Git Checkout Switch Symlinks Remove Releases Switch Symlinks
  22. Adding Tasks initialize Create Directories update Create Symlinks Work ow

    migrate Flow Migrate switch Switch Symlinks cleanup Remove Releases ... Git Checkout Flow Application
  23. execute(...) rollback(...) Task Task

  24. Rollback initialize update Work ow Base Application migrate switch cleanup

    ... Create Directories Create Symlinks Git Checkout Switch Symlinks Remove Releases Flow Migrate Flow Migrate
  25. Rollback initialize update Work ow Base Application migrate switch cleanup

    ... Create Directories Create Symlinks Git Checkout Switch Symlinks Remove Releases Flow Migrate Flow Migrate
  26. The Node view myserver1.example.com Apache www.example.com VHosts Deployment path ├──

    cache ├── releases └── shared initialize
  27. The Node view myserver1.example.com Apache www.example.com next.example.com VHosts Deployment path

    ├── cache ├── releases │ ├── 20120101111100 │ └── next └── shared initialize update
  28. The Node view myserver1.example.com Apache www.example.com next.example.com VHosts Deployment path

    initialize update switch ... ├── cache ├── releases │ ├── 20120101111100 │ └── current └── shared
  29. The Node view myserver1.example.com Apache www.example.com next.example.com VHosts Deployment path

    ├── cache ├── releases │ ├── 20120101111100 │ └── current └── shared Next release
  30. The Node view myserver1.example.com Apache www.example.com next.example.com VHosts Deployment path

    initialize update ├── cache ├── releases │ ├── 20120101111100 │ ├── 20120102122200 │ ├── current │ └── next └── shared
  31. The Node view myserver1.example.com Apache www.example.com next.example.com VHosts Deployment path

    initialize ├── cache ├── releases │ ├── 20120101111100 │ ├── 20120102122200 │ ├── previous │ └── current └── shared update switch ...
  32. Multiple Nodes myserver1 initialize update switch ... myserver2 myserver3 initialize

    initialize update update ... ... Work ow switch switch cleanup cleanup cleanup
  33. Further Features Multi application Simulate deployments Smoke tests Custom tasks

  34. Application

  35. Deploying a Flow Application Flow Application Template Symlink Data Migrate

    Doctrine Composer install Create Directories ...
  36. Application TYPO3

  37. Application NEOS

  38. Deploying a Neos site Neos Application Template Symlink Data Migrate

    Doctrine Composer install Create Directories ... Import Site
  39. Current State In daily use for production But in Beta

    state Git is favored Flexible update is coming SVN, rsync, Tar
  40. Update without git Code Assets Configuration Content Your website Your

    Server Surf Deployment rsync Git Repository scp / ssh https://review.typo3.org/18969
  41. Thanks to Christopher Hlubek & Tobias Liebig for preparing most

    of these slides and their work on TYPO3 Surf !
  42. Your Speaker slides: speakerdeck.com/kdambekalns|slideshare.net/k sh web: karsten.dambekalns.de email: karsten@typo3.org |

    karsten@dambekalns.de twitter & app.net: @kdambekalns I am on attr, too…