Share
Embed
F3X12 FLOW3 Project Lifecycle
Project Setup, Deplyoment and Maintenance of FLOW3 projects. By Christopher Hlubek - networkteam GmbH.
hlubek
April 02, 2012
Transcript
39 slides
-
About me Christopher Hlubek CTO networkteam GmbH FLOW3 & TYPO3
Phoenix Core Team -
Non-Functional Project Risks Framework updates and changes Bugs in application
code Bugs in framework code Bugs in 3rd party code Erroneous deployment ... -
Composition of a FLOW3 application Distribution Configuration Build Application Packages
Framework Packages Community Packages Data Web -
Create a distribution git clone --recursive -o typo3 \ git://git.typo3.org/FLOW3/Distributions/Base.git
MyDistribution git remote add origin ssh://myrepo.local/path/to/distribution.git -
Versioning with Git Your Git Server Distribution Application Packages TYPO3
Git Server Community Packages TYPO3 / Community Git Server Framework Packages simple -
Your Git Server Distribution Application Packages TYPO3 Git Server Community
Packages TYPO3 / Community Git Server Framework Packages more flexible Versioning with Git -
Package Repository Git Vendor Branching [TASK] Lorem ipsum ... [BUGFIX]
Some bugfix ... [FEATURE] Some feature ... [TASK] Latest ... vendor/master origin/master Submodule Pointer -
git checkout master git commit ... git push origin master
Create a hotfix -
Package Repository Git Vendor Branching [TASK] Lorem ipsum ... [BUGFIX]
Some bugfix ... [FEATURE] Some feature ... [TASK] Latest ... vendor/master Submodule Pointer [HOTFIX] Custom patch origin/master -
git fetch vendor git merge vendor/master master git push origin
master Update the Package -
Package Repository Git Vendor Branching [TASK] Lorem ipsum ... [BUGFIX]
Some bugfix ... [FEATURE] Some feature ... [TASK] Latest ... [HOTFIX] Custom patch origin/master Submodule Pointer Merge remote-tracking ... [TASK] New change ... vendor/master -
Unit Tests vs. Functional Tests FLOW3 Framework Application Package Application
Class / Unit Database Functional Test Unit Test } -
Unit Tests Test complex logic in isolation Find the source
of a problem Should test a restricted set of classes -
Functional Tests Test code with the framework and database Check
that a feature works Isolation is difficult Use mocks or fixtures for data or external services -
Where to test? High risk of failure High complexity Hard
to test manually More Tests Less Tests -
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 -
Deployment with Surf SSH CI Server / Dev Host Surf
Node Node Git Repositories Git -
The Surf Model Server Node Code / Artifacts Application Node
Deployment Environments Deployment Workflow -
Deployment process initialize update migrate finalize test switch cleanup Create
release structure Git update Migration (e.g. Doctrine) Finalize release Test release (smoke test) Publish release to live state Cleanup old releases Stages -
INFO Deploying vagrant INFO Using workflow "Simple workflow" DEBUG ======
Stage initialize ====== DEBUG **** Node vagrant **** DEBUG * Application FLOW3 * DEBUG Executing stage "initialize" on "vagrant" for application FLOW3 DEBUG 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 FLOW3 DEBUG 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 > 7662553d5e666261a3a5bc2d6122096e7e21e40a DEBUG $vagrant: "if [ -d /home/planetflow3/deploy/cache/localgitclone ]; then cd /home/planetflow3/deploy/cache/localgitclone && git fetch -q origin && git reset -q --hard 7662553d5e666261a3a5bc2d6122096e7e21e40a && 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 && git submodule -q init && git submodule -q sync && git submodule -q update; fi" INFO > synced Build/Common INFO > synced Packages/Application/Libtextcat INFO > synced Packages/Application/Planetflow3 INFO > synced Packages/Framework/Doctrine.Common INFO > synced Packages/Framework/Doctrine.DBAL INFO > synced Packages/Framework/Doctrine.ORM INFO > synced Packages/Framework/Symfony.Component.Yaml INFO > synced Packages/Framework/TYPO3.FLOW3 INFO > synced Packages/Framework/TYPO3.Fluid INFO > synced Packages/Framework/TYPO3.Party DEBUG $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 FLOW3 DEBUG 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 FLOW3 DEBUG 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 directory DEBUG ====== Stage migrate ====== DEBUG **** Node vagrant **** DEBUG * Application FLOW3 * DEBUG Executing stage "migrate" on "vagrant" for application FLOW3 DEBUG 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"