F3X12 FLOW3 Project Lifecycle

1,321 views
1,214 views

Published on

Project Setup, Deplyoment and Maintenance of FLOW3 projects. By Christopher Hlubek - networkteam GmbH.

Published in: Technology, Design
0 Comments
1 Like
Statistics
Notes
  • Be the first to comment

No Downloads
Views
Total views
1,321
On SlideShare
0
From Embeds
0
Number of Embeds
1
Actions
Shares
0
Downloads
14
Comments
0
Likes
1
Embeds 0
No embeds

No notes for slide

F3X12 FLOW3 Project Lifecycle

  1. 1. Project Lifecycle
  2. 2. TheProject LifecycleProject Setup, Deplyoment and Maintenance of FLOW3 projects.
  3. 3. About me Christopher Hlubek CTO networkteam GmbH FLOW3 & TYPO3 Phoenix Core Team
  4. 4. Requirements Support Architecture Deploy Design Test ImplementationSoftwareDevelopmentLifecycle
  5. 5. Code is not everything Architecture Test Deploy SupportSoftwareDevelopmentLifecycle
  6. 6. Non-Functional Project RisksFramework updates and changes Bugs in application code Bugs in framework code Bugs in 3rd party code Erroneous deployment ...
  7. 7. Architecture
  8. 8. Composition of a FLOW3 application Build Application PackagesConfiguration Community Packages Data Framework Packages Web Distribution
  9. 9. Project Setup
  10. 10. Create a distributiongit clone --recursive -o typo3 git://git.typo3.org/FLOW3/Distributions/Base.git MyDistributiongit remote add origin ssh://myrepo.local/path/to/distribution.git
  11. 11. Versioning with Git simple Distribution Application Packages Your Git Server TYPO3 / Community Git Community Packages Server TYPO3 Git Server Framework Packages
  12. 12. Emergency Hotfix - or - Core Hacks
  13. 13. Versioning with Git more flexible Distribution Application Packages Your Git Server TYPO3 / Community Git Community Packages Server TYPO3 Git Server Framework Packages
  14. 14. Git Vendor BranchingSubmodule Pointer origin/master [TASK] Latest ... vendor/master [FEATURE] Some feature ... [BUGFIX] Some bugfix ... [TASK] Lorem ipsum ... Package Repository
  15. 15. Create a hotfixgit checkout mastergit commit ...git push origin master
  16. 16. Git Vendor BranchingSubmodule Pointer origin/master [HOTFIX] Custom patch vendor/master[TASK] Latest ... [FEATURE] Some feature ... [BUGFIX] Some bugfix ... [TASK] Lorem ipsum ... Package Repository
  17. 17. Update the Packagegit fetch vendorgit merge vendor/master mastergit push origin master
  18. 18. Git Vendor BranchingSubmodule Pointer origin/master Merge remote-tracking ... vendor/master [TASK] New change ... [HOTFIX] Custom patch [TASK] Latest ... [FEATURE] Some feature ... [BUGFIX] Some bugfix ... [TASK] Lorem ipsum ... Package Repository
  19. 19. Test
  20. 20. Unit Tests vs. Functional TestsApplication Class / Unit } Unit Test Application Package Functional Test FLOW3 Framework Database
  21. 21. Unit TestsTest complex logic in isolationFind the source of a problemShould test a restricted set of classes
  22. 22. Functional TestsTest code with the framework and databaseCheck that a feature worksIsolation is difficultUse mocks or fixtures for data or external services
  23. 23. Where to test? High risk of failure High complexity Hard to test manually Less Tests More Tests
  24. 24. Test strategies 101
  25. 25. Don‘t test everythingTest the important stuff
  26. 26. Test every feature with one functional test (at least)
  27. 27. Reproduce bugs with tests(they won‘t come back)
  28. 28. oyment Deployment Deploy Deployment Deployment Deployment
  29. 29. Environments Integration Load-TestingLive Staging Development Development
  30. 30. Manual deployment# ssh testuser@my-staging-server.example.comuser123 $ cd /var/www/projectuser123 $ git pull --rebaseuser123 $ git submodule inituser123 $ git submodule updateuser123 $ rm -rf Data/Temporary/Productionuser123 $ ./flow3 doctrine:migrateuser123 $ ./flow3 cache:warmup# ssh user123@my-live-server1.example.comuser123 $ cd /home/myproject/public_htmluser123 $ git pull --rebaseuser123 $ git submodule inituser123 $ git submodule updateuser123 $ rm -rf Data/Temporary/Productionuser123 $ ./flow3 doctrine:migrateuser123 $ ./flow3 cache:warmup# ssh user123@my-live-server2.example.comuser123 $ cd /home/myproject/public_htmluser123 $ git pull --rebase Lot of workuser123 $ git submodule init Erroneoususer123 $ git submodule updateuser123 $ rm -rf Data/Temporary/Productionuser123 $ ./flow3 doctrine:migrateuser123 $ ./flow3 cache:warmup
  31. 31. AutomateddeploymentA custom script?Rollback on errors?Distributed deployment?
  32. 32. Meet Surf
  33. 33. Deployment with Surf SSH Node Surf CI Server / Node Dev Host Git Repositories Git
  34. 34. The Surf Model Deployment EnvironmentsWorkflow Deployment Application Code / Artifacts Node Node Server
  35. 35. Deployment process initialize Create release structure update Git update migrate Migration (e.g. Doctrine)Stages finalize Finalize release test Test release (smoke test) switch Publish release to live state cleanup Cleanup old releases
  36. 36. INFO Deploying vagrantINFO Using workflow "Simple workflow"DEBUG ====== Stage initialize ======DEBUG **** Node vagrant ****DEBUG * Application FLOW3 *DEBUG Executing stage "initialize" on "vagrant" for application FLOW3DEBUG Execute task "typo3.surf:createdirectories" on "vagrant" for application "FLOW3"DEBUG $vagrant: "test -d /home/planetflow3/deploy"DEBUG $vagrant: "mkdir -p /home/planetflow3/deploy/releases;mkdir -p /home/planetflow3/deploy/shared;mkdir -p /home/planetflow3/deploy/releases/20120331105449;cd /home/planetflow3/deploy/releases;ln -snf ./20120331105449 next"DEBUG Execute task "typo3.surf:flow3:createdirectories" on "vagrant" for application "FLOW3"DEBUG $vagrant: "mkdir -p /home/planetflow3/deploy/shared/Data/Logs;mkdir -p /home/planetflow3/deploy/shared/Data/Persistent;mkdir -p /home/planetflow3/deploy/shared/Configuration"DEBUG ====== Stage update ======DEBUG **** Node vagrant ****DEBUG * Application FLOW3 *DEBUG Executing stage "update" on "vagrant" for application FLOW3DEBUG Execute task "typo3.surf:gitcheckout" on "vagrant" for application "FLOW3"DEBUG $vagrant: "git ls-remote git://github.com/chlu/Planetflow3-Distribution.git refs/heads/master | awk {print $1 }"INFO > 7662553d5e666261a3a5bc2d6122096e7e21e40aDEBUG $vagrant: "if [ -d /home/planetflow3/deploy/cache/localgitclone ]; then cd /home/planetflow3/deploy/cache/localgitclone && git fetch -q origin && git reset -q --hard7662553d5e666261a3a5bc2d6122096e7e21e40a && git submodule -q init && for mod in `git submodule status | awk { print $2 }`; do git config -f .git/config submodule.${mod}.url `git config -f .gitmodules--get submodule.${mod}.url` && echo synced $mod; done && git submodule -q sync && git submodule -q update && git clean -q -d -x -ff; else git clone -q git://github.com/chlu/Planetflow3-Distribution.git /home/planetflow3/deploy/cache/localgitclone && cd /home/planetflow3/deploy/cache/localgitclone && git checkout -q -b deploy 7662553d5e666261a3a5bc2d6122096e7e21e40a && gitsubmodule -q init && git submodule -q sync && git submodule -q update; fi"INFO > synced Build/CommonINFO > synced Packages/Application/LibtextcatINFO > synced Packages/Application/Planetflow3INFO > synced Packages/Framework/Doctrine.CommonINFO > synced Packages/Framework/Doctrine.DBALINFO > synced Packages/Framework/Doctrine.ORMINFO > synced Packages/Framework/Symfony.Component.YamlINFO > synced Packages/Framework/TYPO3.FLOW3INFO > synced Packages/Framework/TYPO3.FluidINFO > synced Packages/Framework/TYPO3.PartyDEBUG $vagrant: "cp -RPp /home/planetflow3/deploy/cache/localgitclone/. /home/planetflow3/deploy/releases/20120331105449 && (echo 7662553d5e666261a3a5bc2d6122096e7e21e40a > /home/planetflow3/deploy/releases/20120331105449REVISION)"DEBUG Task "typo3.surf:flow3:symlinkdata" after "typo3.surf:gitcheckout" for application FLOW3DEBUG Execute task "typo3.surf:flow3:symlinkdata" on "vagrant" for application "FLOW3"DEBUG $vagrant: "mkdir -p /home/planetflow3/deploy/releases/20120331105449/Data;cd /home/planetflow3/deploy/releases/20120331105449;ln -sf ../../../shared/Data/Logs ./Data/Logs;ln -sf ../../../shared/Data/Persistent ./Data/Persistent"DEBUG Task "typo3.surf:flow3:symlinkconfiguration" after "typo3.surf:gitcheckout" for application FLOW3DEBUG Execute task "typo3.surf:flow3:symlinkconfiguration" on "vagrant" for application "FLOW3"DEBUG $vagrant: "cd /home/planetflow3/deploy/releases/20120331105449/Configuration;rm -f Production/*;rmdir Production;mkdir -p ../../../shared/Configuration/Production;ln -snf ../../../shared/Configuration/Production Production"INFO > rmdir: failed to remove `Production: No such file or directoryDEBUG ====== Stage migrate ======DEBUG **** Node vagrant ****DEBUG * Application FLOW3 *DEBUG Executing stage "migrate" on "vagrant" for application FLOW3DEBUG Execute task "typo3.surf:flow3:migrate" on "vagrant" for application "FLOW3"DEBUG $vagrant: "cd /home/planetflow3/deploy/releases/20120331105449 && FLOW3_CONTEXT=Production ./flow3 typo3.flow3:doctrine:migrate"
  37. 37. Deployment structure < Document Root
  38. 38. Deployment FeaturesClustered deploymentConfiguration overridesSmoke testsCustom tasksFlexible workflows
  39. 39. ?Questions?

×