TYPO3.Flow has proven to be a dynamic and modern framework for building enterprise business applications. But an efficient development and continues delivery process requires more than just a great framework: Ramp up time, quality assurance and the cycle time in the project needs to be optimized as well.
This talk is an overview of a complete development and deployment pipeline for TYPO3.Flow projects. Starting from a painless automated setup of local development environments and ending as a tested, installable package in the hands of the customers Application Management Team.
All steps of the workflow will be described in detail. Starting with the setup of virtual machines for the developer with Vagrant and Chef. Continuing with the Jenkins setup for building and deploying the application on different systems.
And - as with every project - an efficient quality assurance process is crucial for continuous delivery: So this talk will also describe the test-strategy in the deployment pipeline and the use of automated tests to test different aspects of the application (PHPUnit, Acceptance, Contract-Based Tests and Behavior Tests with Cucumber).
8. Overview
Development Continuous Delivery Deployment
Samstag, 20. April 13
9. The Developer
What does a developer need to be happy?
short ramp up time
fast development system
development environment with full access
Samstag, 20. April 13
10. Development System - fast ramp up time
Ask your IT for a new development environment
Wait until it is finished
Buy a new development server if required
Grant access to the developer for the project
Samstag, 20. April 13
12. Development System - fast development server
t 4 t 8
j ec j ec
Pro Pro
3 7
je ct je ct
Pro Pro
ct
2
ec t6
ro je oj
P Pr
1 5
je ct je ct
P ro P ro
Samstag, 20. April 13
13. Development System - full access
I want I want
change stability
Dev Op
Samstag, 20. April 13
17. Vagrant - Ramp up time
Install Vagrant
$ git clone aoe_cookbook
$ PROJECT=myProject vagrant up
Samstag, 20. April 13
18. Vagrant - Ramp up time
Install Vagrant
$ git clone aoe_cookbook
$ PROJECT=myProject vagrant up
Enter the commands
Get a coffee
Start working
Samstag, 20. April 13
19. Vagrant - add some (custom) config and colors
.gitconfig
.gitcommit-template
.bashrc
.vimrc
.zshrc
Samstag, 20. April 13
20. Vagrant - add some (custom) config and colors
.gitconfig m
te
.gitcommit-template sys
ost
.bashrc r h
ou
.vimrc y
li ke
.zshrc e ls
Fe
Samstag, 20. April 13
21. Vagrant - Cookbooks
http://community.opscode.com/cookbooks
apache
mysql
php
composer
.......
Samstag, 20. April 13
26. Vagrant - full access
No need to ask the IT
Try out some fancy new stuff
Destroyed the server? vagrant destroy / vagrant up
Add a recipe and it is documented
Samstag, 20. April 13
27. Vagrant - different Platforms
Runs on:
http://downloads.vagrantup.com/
Samstag, 20. April 13
28. Vagrant - TYPO3 Server Team
....and some less important sites.
Samstag, 20. April 13
34. Overview
Installation Package
e nt
QA loym
p
De
Q A Lat
est
GIT
ry De
ito plo
os y
ep
Version Control ac tR
r tif
A
Latest & Deploy System
Samstag, 20. April 13
36. The Jenkins Jobs
TriggerCommit Install on Latest
Commit Contract Based Tests
PHPUnit Acceptance Tests
Build Package
Install on Deploy
Samstag, 20. April 13
37. Jenkins - Commit Build
Collect required resources Tag
Update dependencies
Run the unit tests
If tests fail, inform the team
Tag the package
Trigger the build packages
composer update
Samstag, 20. April 13
38. Jenkins - Build package
Run compass to generate the css files
Exclude some files, like .git*
Generate a version file
Build the package
Archive the package
Samstag, 20. April 13
39. Jenkins - Install on latest
Copy the package to the workspace
Extract the package
Use TYPO3.Surf for the installation
Settings for the system are preconfigured with the context
FLOW_CONTEXT = Production/Latest
Samstag, 20. April 13
40. Jenkins - Import test data
Command line controller to import test data...
..and to install static data from external systems
Never work on real data!!
Latest
Test data
Static data
Samstag, 20. April 13
41. Jenkins - Running tests
Contract tests
Calling the SOAP Web Service
Validate the response with xsd files
Acceptance tests
Running headless cucumber tests
Samstag, 20. April 13
42. Jenkins - Cucumber
Running headless tests for the web (capybara)
Running Android tests (calabash-android)
Running iOS tests (calabash-ios)
Samstag, 20. April 13
43. Jenkins - Cucumber
Running headless tests for the web (capybara)
Running Android tests (calabash-android)
Running iOS tests (calabash-ios)
Samstag, 20. April 13
45. Jenkins - Publish release
Remove unused context based settings
Publish the package so the customer can access it
Add a version file for automatic updates
Samstag, 20. April 13
46. Jenkins - Publish a different release
Development Branch Release Branch
Pipeline Pipeline
Development Package Release Package
Samstag, 20. April 13
47. Jenkins - Publish a different release
Development Branch Release Branch
s
ate
p d
k u
or
Pipeline w
Pipeline
e
m
fra
n o
Development Package Release Package
Samstag, 20. April 13
52. Overview
Development Continuous Delivery Deployment
Samstag, 20. April 13
53. Deployment
Release Package
Sta
gin
g
ry Pro
osito du
ep ct
ac tR ion
r tif
A
Samstag, 20. April 13
54. Deployment - TYPO3.Surf
TYPO3.Surf is part of the release package
Same install process as on the latest and deploy system
Installer is tested over and over again
TYPO3.Surf inside
Samstag, 20. April 13
55. Deployment - Parameters
Parameters
Customers test server
Parameters
Production server
Samstag, 20. April 13
57. Deployment - Installation steps
ease
l
Re
nt
WWW C urre
Store release path (for a rollback)
Update database credentials
ease
l
Create a crontab file Re
New
Doctrine migrate
Samstag, 20. April 13
58. Deployment - Installation steps
ease
l
Re
nt
WWW C urre
Add context to htaccess switch
Set file permissions
ease
l
Warm up caches Re
New
Switch: create a new symlink
Samstag, 20. April 13
59. Deployment - Downtime
How long does it take
to delete a symlink
and
create a new one?
Samstag, 20. April 13