1 of 61

TYPO3 deployment

with Jenkins

Daniel Klockenkämper @derdanne

T3CRR 2014 dk@marketing-factory.de

2 of 61

before Jenkins

3 of 61

multiple people working on every deployment

4 of 61

we were really slow

5 of 61

deployment quality was low

6 of 61

rarely deployed

big changes

7 of 61

rollbacks were painful

8 of 61

the classics:

9 of 61

technically that should work ...

10 of 61

that worked on dev ...

11 of 61

since when we have this in prod?

12 of 61

let’s debug in production, yay

13 of 61

14 of 61

Let’s check out our

mission objectives!

15 of 61

velocity

16 of 61

quality

17 of 61

simplicity

18 of 61

workflow reflection

19 of 61

automation

20 of 61

let us write some shell scripts!

21 of 61

OK, bad idea - so why Jenkins?

22 of 61

natively supports our favorite versioning system

svn, git, cvs ...

23 of 61

it is easy to install

24 of 61

it has dozens of plugins

25 of 61

it uses build management tools like ant or maven

26 of 61

you can trigger build jobs from external sources

27 of 61

easy to monitor

28 of 61

REST API

XML, JSON, Python

29 of 61

you can use notifications

email, jabber, ...

30 of 61

it is free!

31 of 61

everybody loves pushing buttons!

32 of 61

cool story bro!

33 of 61

what are we doing with it?

34 of 61

testing code

syntax, unit, integration ...

35 of 61

deployment to our environments user-dev, dev, staging, live

36 of 61

synchronize environments from live

37 of 61

test performance of

our live websites

38 of 61

minify css

concatenate js

compile sass

39 of 61

any prerequisites for deployment?

40 of 61

use a versioning system!!!

41 of 61

strictly separate configs from userdata

42 of 61

do not push userdata in your versioning system!

43 of 61

develop in local environment (vagrant?)

44 of 61

force devs to not insert TS in DB

45 of 61

force be users to not change config or install / change extensions

46 of 61

install extensions:

coreapi (6.2)

cleartypo3cache and t3deploy (4.5)

47 of 61

then which steps to deploy

TYPO3 6.2

code to production?

48 of 61

new tag of code

triggers minify/concat job

49 of 61

anybody could now push the code to production

even the project manager :)

50 of 61

tests syntax of files that have changed

51 of 61

checks for modifications

on the target

52 of 61

checks out code on the target system

53 of 61

reverts

typo3conf/PackageStates.php

54 of 61

deletes temporary files in typo3temp

Cache/*

compressor/*

cs/*

llxml/*

sprites/*

rtehtmlarea*

55 of 61

clears opcache code of php

opcache_reset();

56 of 61

generates new TYPO3 opcode cache

using curl request

57 of 61

clears cache in db:

cli_dispatch.phpsh extbase cacheapi:clearallcaches

58 of 61

updates the database:

cli_dispatch.phpsh extbase databaseapi:databasecompare 4,2,3

59 of 61

triggers frontend testing suite

(sitespeed.io)

60 of 61

sends notification when build was not successful

61 of 61