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

FLOW & TYPO3 Deployment with Surf

hlubek
October 05, 2012

FLOW & TYPO3 Deployment with Surf

Deployment with TYPO3 Surf at T3CON12 in Stuttgart. Surf is a new deployment tool built on top of the Flow PHP framework.

hlubek

October 05, 2012
Tweet

More Decks by hlubek

Other Decks in Technology

Transcript

  1. 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 Erroneous
  2. Ride the wave Code Assets Configuration Your application Your Server

    Surf TODO Add wave illustration Deployment SSH Git Repository
  3. 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);
  4. The Surf Model Server Node Code / Assets Application Node

    Deployment Environments Deployment Workflow
  5. Workflow 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
  6. Tasks initialize update Workflow Base Application migrate switch cleanup ...

    Create Directories Create Symlinks Git Checkout Switch Symlinks Remove Releases Switch Symlinks
  7. Adding Tasks initialize Create Directories update Create Symlinks Workflow migrate

    Flow Migrate switch Switch Symlinks cleanup Remove Releases ... Git Checkout Flow Application
  8. Rollback initialize update Workflow Base Application migrate switch cleanup ...

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

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

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

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

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

    initialize update ├── cache ├── releases │ ├── 20120101111100 │ ├── 20120102122200 │ └── current └── shared
  14. 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 ...
  15. The Node view myserver1.example.com Apache www.example.com next.example.com VHosts Deployment path

    initialize update switch ... ├── 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 ... ... Workflow switch switch cleanup cleanup cleanup
  18. Deploying a Flow Application Flow Application Template Symlink Data Migrate

    Doctrine Composer install Create Directories ...
  19. Deploying a TYPO3 CMS Challenges typo3_src uploads fileadmin Configuration Assets

    Templates git submodule Extension Symlink into „share“ Special Tasks
  20. Deploying a TYPO3 CMS Special Tasks Clear Caches (all, pages,

    configuration) Delete files in typo3temp Compare Database Tool Extension UPDATE function Set configuration Refresh extension list Run Unittests (EXT:phpunit) Create sys_news record Execute reports Add (de-)activate scheduler tasks Run SQL EXT:coreapi http://forge.typo3.org/projects/show/extension-coreapi
  21. Current State Git is favored Flexible update planned SVN, rsync,

    Tar In daily use for production But in Beta state Stable release in Early 2013