deploying typo3 neos websites using surf
TRANSCRIPT
Karsten Dambekalnskarsten.dambekalns.de
Your Speaker
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
Software deployment is all of the activities that
make a software system available for use.
Wikipedia
Manual deployment# ssh [email protected] $ 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 [email protected] $ 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 [email protected] $ 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
Lot of workError prone
Ride the wave
CodeAssets
ConfigurationContent
Yourwebsite
Your Server
Surf
DeploymentSSH Git
Repository
A simple deployment
Build/Surf/planetflow3.php
<?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);
Work!owinitialize
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
Tasks
initialize
update
Work!ow Base Application
migrate
switch
cleanup
...
Create Directories
Create Symlinks Git Checkout
Switch Symlinks
Remove Releases
Switch Symlinks
Adding Tasks
initialize Create Directories
update Create Symlinks
Work!ow
migrate Flow Migrate
switch Switch Symlinks
cleanup Remove Releases
...
Git Checkout
Flow Application
Rollback
initialize
update
Work!ow Base Application
migrate
switch
cleanup
...
Create Directories
Create Symlinks Git Checkout
Switch Symlinks
Remove Releases
Flow MigrateFlow Migrate
Rollback
initialize
update
Work!ow Base Application
migrate
switch
cleanup
...
Create Directories
Create Symlinks Git Checkout
Switch Symlinks
Remove Releases
Flow MigrateFlow Migrate
The Node viewmyserver1.example.com
Apache
www.example.com
VHos
ts
Deployment path
├── cache├── releases└── shared
initialize
The Node viewmyserver1.example.com
Apache
www.example.com
next.example.comVHos
ts
Deployment path
├── cache├── releases│ ├── 20120101111100│ └── next└── shared
initialize update
The Node viewmyserver1.example.com
Apache
www.example.com
next.example.comVHos
ts
Deployment path
initialize update switch...
├── cache├── releases│ ├── 20120101111100│ └── current└── shared
The Node viewmyserver1.example.com
Apache
www.example.com
next.example.comVHos
ts
Deployment path
├── cache├── releases│ ├── 20120101111100│ └── current└── shared
Next release
The Node viewmyserver1.example.com
Apache
www.example.com
next.example.comVHos
ts
Deployment path
initialize update
├── cache├── releases│ ├── 20120101111100│ ├── 20120102122200│ ├── current│ └── next└── shared
The Node viewmyserver1.example.com
Apache
www.example.com
next.example.comVHos
ts
Deployment path
initialize
├── cache├── releases│ ├── 20120101111100│ ├── 20120102122200│ ├── previous│ └── current└── shared
update switch...
Multiple Nodesmyserver1
initialize
update
switch
...
myserver2 myserver3
initialize initialize
update update
... ...
Wor
k!ow
switch switch
cleanup cleanup cleanup
Deploying a Flow Application
Flow Application Template
SymlinkData
Migrate Doctrine
Composer install
Create Directories
...
Deploying a Neos site
Neos Application Template
SymlinkData
Migrate Doctrine
Composer install
Create Directories
...ImportSite
Current StateIn daily use for productionBut in Beta state
Git is favored
Flexible update is comingSVN, rsync, Tar
Update without git
CodeAssets
ConfigurationContent
Yourwebsite
Your Server
Surf
Deployment
rsync
GitRepository
scp / ssh
https://review.typo3.org/18969
Thanks toChristopher Hlubek
& Tobias Liebigfor preparing most of these slides
and their work on TYPO3 Surf
!
Your Speaker
slides: speakerdeck.com/kdambekalns|slideshare.net/k"sh
web: karsten.dambekalns.deemail: [email protected] | [email protected]
twitter & app.net: @kdambekalns
I am on !attr, too…