42
TYPO3 Neos Deployment with

Deploying TYPO3 Neos websites using Surf

Embed Size (px)

Citation preview

TYPO3 Neos Deployment

with

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

What isdeployment?

Software deployment is all of the activities that

make a software system available for use.

Wikipedia

How to deployyour site ?

ManualDeployment

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

AutomatedDeployment

Possible solutions

PHP?

BashScript

PhingScript

Capistrano

AntScript

...

Environments

Live Staging

Integration Load-Testing

DevelopmentDevelopment

Requirements

MultipleEnvironments

Rollback Extensibility

ClusteringSmoke Tests ...

Meet

Where‘s the waveContinuous Integration

InfrastructureSurf

Development

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);

Running the deployment

Surf Architecture

Flow

SurfPack

ages

Your package

Standaloneor

Included

The Surf Model

ServerNode

Code / AssetsApplication

Node

Deployment EnvironmentsDeployment

Wor

k!ow

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

execute(...)

rollback(...)

Task

Task

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

Further Features

Multi application

Simulate deployments

Smoke tests

Custom tasks

Application

Deploying a Flow Application

Flow Application Template

SymlinkData

Migrate Doctrine

Composer install

Create Directories

...

Application

TYPO3

Application

NEOS

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

!