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.

2b68bc93708466a655a4c60458dc7955?s=128

Martin Helmich

April 20, 2013
Tweet

Transcript

  1. Scalable

  2. YOUR SPEAKER Martin

  3. LAST

  4. Software

  5. Manual

  6. COMMON

  7. 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
  8. 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
  9. HERE:

  10. HERE:

  11. TYPO3

  12. TYPO3

  13. ├── cache │ └── localgitclone ├── releases │ ├── 20130324175345

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

  15. Install

  16. INITIALIZE UPDATE MIGRATE FINALIZE TEST SWITCH CLEANUP SURF

  17. Use

  18. JENKINS Main Build Deployment Build Auxiliary Build TYPO3

  19. Use

  20. INITIALIZE

  21. N2 N3 N4 N1 N2 N3 N4 INIT

  22. Execute

  23. None
  24. None
  25. <?php /** @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); } }
  26. <?php /** @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); } }
  27. <?php /** @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); } }
  28. Deployment Build Deploy

  29. Deployment Build Deploy

  30. „Update“ Build N1 N2 N3 N4 ON

  31. Use

  32. Use

  33. Use

  34. 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
  35. TYPO3

  36. TYPO3

  37. TYPO3

  38. USEFUL

  39. •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,
  40. Questions ?

  41. Image

  42. Image