Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Deploying TYPO3 Neos websites using Surf

Deploying TYPO3 Neos websites using Surf

Presentation given at T3CON NA in San Francisco.

Karsten Dambekalns

May 31, 2013
Tweet

More Decks by Karsten Dambekalns

Other Decks in Programming

Transcript

  1. 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
  2. Software deployment is all of the activities that make a

    software system available for use. Wikipedia
  3. Manual deployment # ssh [email protected] 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 [email protected] 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 [email protected] 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
  4. Ride the wave Code Assets Configuration Content Your website Your

    Server Surf Deployment SSH Git Repository
  5. 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);
  6. The Surf Model Server Node Code / Assets Application Node

    Deployment Environments Deployment Work ow
  7. 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
  8. Tasks initialize update Work ow Base Application migrate switch cleanup

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

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

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

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

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

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

    ├── cache ├── releases │ ├── 20120101111100 │ └── current └── shared Next release
  15. 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
  16. 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 ...
  17. Multiple Nodes myserver1 initialize update switch ... myserver2 myserver3 initialize

    initialize update update ... ... Work ow switch switch cleanup cleanup cleanup
  18. Deploying a Flow Application Flow Application Template Symlink Data Migrate

    Doctrine Composer install Create Directories ...
  19. Deploying a Neos site Neos Application Template Symlink Data Migrate

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

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

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

    of these slides and their work on TYPO3 Surf !