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. TYPO3 Neos Deployment
    with

    View Slide

  2. Karsten Dambekalns
    karsten.dambekalns.de
    Your Speaker

    View Slide

  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

    View Slide

  4. What is
    deployment
    ?

    View Slide

  5. Software deployment is
    all of the activities that
    make a software system
    available for use.
    Wikipedia

    View Slide

  6. How to deploy
    your site
    ?

    View Slide

  7. Manual
    Deployment

    View Slide

  8. 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

    View Slide

  9. Automated
    Deployment

    View Slide

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

    View Slide

  11. Environments
    Live Staging
    Integration Load-Testing
    Development
    Development

    View Slide

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

    View Slide

  13. Meet

    View Slide

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

    View Slide

  15. Ride the
    wave
    Code
    Assets
    Configuration
    Content
    Your
    website
    Your Server
    Surf
    Deployment
    SSH Git
    Repository

    View Slide

  16. A simple deployment
    Build/Surf/planetflow3.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);

    View Slide

  17. Running the deployment

    View Slide

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

    View Slide

  19. The Surf Model
    Server
    Node
    Code / Assets
    Application
    Node
    Deployment
    Environments
    Deployment
    Work ow

    View Slide

  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

    View Slide

  21. Tasks
    initialize
    update
    Work ow Base Application
    migrate
    switch
    cleanup
    ...
    Create Directories
    Create Symlinks Git Checkout
    Switch Symlinks
    Remove Releases
    Switch Symlinks

    View Slide

  22. Adding Tasks
    initialize Create Directories
    update Create Symlinks
    Work ow
    migrate Flow Migrate
    switch Switch Symlinks
    cleanup Remove Releases
    ...
    Git Checkout
    Flow Application

    View Slide

  23. execute(...)
    rollback(...)
    Task
    Task

    View Slide

  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

    View Slide

  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

    View Slide

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

    View Slide

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

    View Slide

  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

    View Slide

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

    View Slide

  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

    View Slide

  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
    ...

    View Slide

  32. Multiple Nodes
    myserver1
    initialize
    update
    switch
    ...
    myserver2 myserver3
    initialize initialize
    update update
    ... ...
    Work ow
    switch switch
    cleanup cleanup cleanup

    View Slide

  33. Further Features
    Multi application
    Simulate deployments
    Smoke tests
    Custom tasks

    View Slide

  34. Application

    View Slide

  35. Deploying a Flow Application
    Flow Application Template
    Symlink
    Data
    Migrate
    Doctrine
    Composer
    install
    Create
    Directories
    ...

    View Slide

  36. Application
    TYPO3

    View Slide

  37. Application
    NEOS

    View Slide

  38. Deploying a Neos site
    Neos Application Template
    Symlink
    Data
    Migrate
    Doctrine
    Composer
    install
    Create
    Directories
    ...
    Import
    Site

    View Slide

  39. Current State
    In daily use for production
    But in Beta state
    Git is favored
    Flexible update is coming
    SVN, rsync, Tar

    View Slide

  40. Update
    without git
    Code
    Assets
    Configuration
    Content
    Your
    website
    Your Server
    Surf
    Deployment
    rsync
    Git
    Repository
    scp / ssh
    https://review.typo3.org/18969

    View Slide

  41. Thanks to
    Christopher Hlubek
    & Tobias Liebig
    for preparing most of these slides
    and their work on TYPO3 Surf
    !

    View Slide

  42. Your Speaker
    slides: speakerdeck.com/kdambekalns|slideshare.net/k sh
    web: karsten.dambekalns.de
    email: [email protected] | [email protected]
    twitter & app.net: @kdambekalns
    I am on attr, too…

    View Slide