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

InspiringFlow13: Scalable Deployment Architectures with TYPO3 Surf, Git and Jenkins

InspiringFlow13: Scalable Deployment Architectures with TYPO3 Surf, Git and Jenkins

License: CC BY-SA

When developing and administrating large-scale distributed applications, deployment and change management becomes a new challenge. Modern version control systems like Git and Continuous Integration platforms like Jenkins or Hudson help automating this process, thus making it more efficient and less error-prone.

This talk aims at presenting how these tools can be used to coordinate deployment processes among large teams in distributed, mission-critical infrastructure systems, and how this process can be supported using build tools (like Apache Ant) and test automation. A special focus of the talk will be on possibilities to integrate the deployment software TYPO3 Surf into Git/Jenkins architectures.

Martin Helmich

April 20, 2013
Tweet

More Decks by Martin Helmich

Other Decks in Programming

Transcript

  1. YOUR SPEAKER
    Martin

    View full-size slide

  2. martin@mybox:~ > ssh myserver.de
    martin@myserver:~ > cd my_app
    martin@myserver:~/my_app > git fetch origin
    martin@myserver:~/my_app > git reset --hard origin/master
    martin@myserver:~/my_app > git submodule update --init
    martin@myserver:~/my_app > ./flow doctrine:migrate
    martin@myserver:~/my_app > ./flow cache:flush
    Manual

    View full-size slide

  3. martin@mybox:~ > ssh myserver.de
    martin@myserver:~ > cd my_app
    martin@myserver:~/my_app > git fetch origin
    martin@myserver:~/my_app > git reset --hard origin/master
    martin@myserver:~/my_app > git submodule update --init
    martin@myserver:~/my_app > ./flow doctrine:migrate
    martin@myserver:~/my_app > ./flow cache:flush
    VERSION

    View full-size slide

  4. ├── cache
    │ └── localgitclone
    ├── releases
    │ ├── 20130324175345
    │ └── current -> ./20130324175345
    └── shared
    BEFORE
    ├── cache
    │ └── localgitclone
    ├── releases
    │ ├── 20130324175345
    │ ├── 20130329184503
    │ ├── previous -> ./20130324175345
    │ └── current -> ./20130329184503
    └── shared
    AFTER
    TYPO3

    View full-size slide

  5. INITIALIZE
    UPDATE
    MIGRATE
    FINALIZE
    TEST
    SWITCH
    CLEANUP
    SURF

    View full-size slide

  6. JENKINS Main
    Build
    Deployment
    Build
    Auxiliary
    Build
    TYPO3

    View full-size slide

  7. N2 N3 N4
    N1
    N2
    N3
    N4
    INIT

    View full-size slide

  8. /** @var $deployment \TYPO3\Surf\Domain\Model\Deployment */
    $workflow = new TYPO3\Surf\Domain\Model\SimpleWorkflow();
    $application = new TYPO3\Surf\Application\BaseApplication('MyApplication');
    // ...
    $deployment->setWorkflow($workflow);
    $deployment->addApplication($application);
    if (getenv('BUILD_TARGET') !== FALSE) {
    $node = new TYPO3\Surf\Domain\Model\Node('node-' . getenv('BUILD_TARGET'));
    $node->setHostname(getenv('BUILD_TARGET'));
    $node->setOptions(array(
    'username' => 'surf'
    ));
    $application->addNode($node);
    } else {
    foreach (array('www01','www02','www03') as $node) {
    $node = new TYPO3\Surf\Domain\Model\Node('node-' . $node);
    $node->setHostname($node);
    $node->setOptions(array(
    'username' => 'surf'
    ));
    $application->addNode($node);
    }
    }

    View full-size slide

  9. /** @var $deployment \TYPO3\Surf\Domain\Model\Deployment */
    $workflow = new TYPO3\Surf\Domain\Model\SimpleWorkflow();
    $application = new TYPO3\Surf\Application\BaseApplication('MyApplication');
    // ...
    $deployment->setWorkflow($workflow);
    $deployment->addApplication($application);
    if (getenv('BUILD_TARGET') !== FALSE) {
    $node = new TYPO3\Surf\Domain\Model\Node('node-' . getenv('BUILD_TARGET'));
    $node->setHostname(getenv('BUILD_TARGET'));
    $node->setOptions(array(
    'username' => 'surf'
    ));
    $application->addNode($node);
    } else {
    foreach (array('www01','www02','www03') as $node) {
    $node = new TYPO3\Surf\Domain\Model\Node('node-' . $node);
    $node->setHostname($node);
    $node->setOptions(array(
    'username' => 'surf'
    ));
    $application->addNode($node);
    }
    }

    View full-size slide

  10. /** @var $deployment \TYPO3\Surf\Domain\Model\Deployment */
    $workflow = new TYPO3\Surf\Domain\Model\SimpleWorkflow();
    $application = new TYPO3\Surf\Application\BaseApplication('MyApplication');
    // ...
    $deployment->setWorkflow($workflow);
    $deployment->addApplication($application);
    if (getenv('BUILD_TARGET') !== FALSE) {
    $node = new TYPO3\Surf\Domain\Model\Node('node-' . getenv('BUILD_TARGET'));
    $node->setHostname(getenv('BUILD_TARGET'));
    $node->setOptions(array(
    'username' => 'surf'
    ));
    $application->addNode($node);
    } else {
    foreach (array('www01','www02','www03') as $node) {
    $node = new TYPO3\Surf\Domain\Model\Node('node-' . $node);
    $node->setHostname($node);
    $node->setOptions(array(
    'username' => 'surf'
    ));
    $application->addNode($node);
    }
    }

    View full-size slide

  11. Deployment
    Build
    Deploy

    View full-size slide

  12. Deployment
    Build
    Deploy

    View full-size slide

  13. „Update“
    Build
    N1
    N2
    N3
    N4
    ON

    View full-size slide

  14. GIT
    PRIMARY
    GIT
    2NDARY
    GERRIT
    JENKINS
    MASTER-1
    JENKINS
    MASTER-2
    BUILD
    NODES
    BUILD
    NODES
    DEV
    DEV
    INT
    DEV
    DEV
    QA
    DEV
    DEV
    LIVE
    TYPO3
    SURF
    TYPO3
    SURF
    Deployment

    View full-size slide

  15. •http://jenkins-ci.org
    •http://forge.typo3.org/projects/package-typo3-surf
    •http://git-scm.org
    •https://github.com/martin-helmich/ant-typo3flow
    •https://github.com/martin-helmich/jenkins-typo3surf-
    plugin
    •http://etobi.de/blog/2012/05/deployment-setup-typo3-surf/
    •http://de.slideshare.net/etobide/t3con12-flow-and-typo3-
    deployment-with-surf
    •https://git.typo3.org/FLOW3/Packages/TYPO3.Surf.git/blob/
    master:/Documentation/Guide/Index.rst
    •Duvall,

    View full-size slide