33. Scrum
Kanban
Continuous Improvement in PHP Projects I Mayflower GmbH I 25th February I 32
34. Scrum Continuous
Kanban Integration
Continuous Improvement in PHP Projects I Mayflower GmbH I 25th February I 32
35. Scrum Continuous Continuous
Kanban Integration Inspection
Continuous Improvement in PHP Projects I Mayflower GmbH I 25th February I 32
36. Scrum Continuous Continuous
Kanban Integration Inspection
Continuous Deployment
Continuous Improvement in PHP Projects I Mayflower GmbH I 25th February I 32
37. Things you don‘t want.
Continuous Improvement in PHP Projects I Mayflower GmbH I 25th February I 33
38. Having your SVN repo in
your webserver‘s docroot.
Continuous Improvement in PHP Projects I Mayflower GmbH I 25th February I 34
39. Using SSH and vi and your
root account on the live
server. Never.
Continuous Improvement in PHP Projects I Mayflower GmbH I 25th February I 35
40. Who‘s still doing this? :-)
Continuous Improvement in PHP Projects I Mayflower GmbH I 25th February I 36
59. Developer VM
Ubuntu 11.04
Continuous Improvement in PHP Projects I Mayflower GmbH I 25th February I 55
60. Testing VM + Jenkins VM:
Ubuntu 11.04
Continuous Improvement in PHP Projects I Mayflower GmbH I 25th February I 56
61. Staging VMs:
Frontend: Ubuntu 11.04
Backend: Ubuntu 10.04 LTS
Continuous Improvement in PHP Projects I Mayflower GmbH I 25th February I 57
62. amazon AWS live:
Frontend: Ubuntu 11.04
Backend: Ubuntu 10.04 LTS
Continuous Improvement in PHP Projects I Mayflower GmbH I 25th February I 58
63. Front Nodes
Varnish
nginx
PHP 5.3 with APC
Zend Framework 1.1 1
dojo toolkit 1.6
Doctrine 2.1
Continuous Improvement in PHP Projects I Mayflower GmbH I 25th February I 59
64. Backend Nodes
MySQL Master/Slave
Apache Solr
PHP 5.3 with APC
RabbitMQ
ejabberd
Continuous Improvement in PHP Projects I Mayflower GmbH I 25th February I 60
65. Development workflow
Continuous Improvement in PHP Projects I Mayflower GmbH I 25th February I 61
66. 1. git workflow
$ git add Foo.php
$ git commit -m ″Bar″
$ ant jslint
$ ant phpunit
...
$ git push
Continuous Improvement in PHP Projects I Mayflower GmbH I 25th February I 62
67. 2. Post commit hook
Build triggered on Jenkins
Continuous Improvement in PHP Projects I Mayflower GmbH I 25th February I 63
68. Jenkins build checks
Continuous Improvement in PHP Projects I Mayflower GmbH I 25th February I 64
69. 1. PHPUnit Build:
Unittests
Controller Tests (Zend_Test)
PHP Code Coverage
Continuous Improvement in PHP Projects I Mayflower GmbH I 25th February I 65
70. 2. Debian Package Build
Continuous Improvement in PHP Projects I Mayflower GmbH I 25th February I 66
71. 3. Deploy to staging
4. Deploy staging to live
Continuous Improvement in PHP Projects I Mayflower GmbH I 25th February I 67
72. What is a build process?
Continuous Improvement in PHP Projects I Mayflower GmbH I 25th February I 68
73. ant sync
ant clean
ant db-update
parallelTasks:
ant phpunit
ant phpcb
ant deb
Continuous Improvement in PHP Projects I Mayflower GmbH I 25th February I 69
74. ant phpunit
<target
name="phpunit"
depends="db-test"
description="Run all tests">
<exec executable="phpunit"
failonerror="true">
<arg line="--configuration $
{basedir}/tests/phpunit-verbose.xml $
{basedir}/tests/AllTests.php" />
</exec>
</target>
Continuous Improvement in PHP Projects I Mayflower GmbH I 25th February I 70
75. parallelTasks:
php_depend
phpmd
phpunit
phpcpd
phpcs
jslint
Continuous Improvement in PHP Projects I Mayflower GmbH I 25th February I 71
76. Build Debian Package
ant autoloader
ant phpunit
ant clean
ant compilejs
ant compilecss
Continuous Improvement in PHP Projects I Mayflower GmbH I 25th February I 72
77. ant deb (I)
<target
name="deb"
depends="autoloader,phpunit-
coverage,clean,autoloader,compilejs,compi
lecss"
description="Generate Debian package">
<exec executable="gpg">
<arg value="--armor" />
<arg value="--import" />
<arg value="scripts/build/deb/
mapolis.mayflower.de.pgp" />
</exec>
<buildnumber />
Continuous Improvement in PHP Projects I Mayflower GmbH I 25th February I 73
78. ant deb (II)
<exec executable="git"
outputproperty="githash">
<arg value="describe" />
<arg value="--always" />
<arg value="--match" />
<arg value="" />
</exec>
<touch file="debian/changelog" />
<move file="debian/changelog"
tofile="debian/changelog.old" />
Continuous Improvement in PHP Projects I Mayflower GmbH I 25th February I 74
79. ant deb (III)
<exec executable="git"
output="debian/changelog.new">
<arg value="log" />
<arg value="-n" />
<arg value="1" />
<arg value='--format=format:mapolis-
web (${build.number}-${githash})
unstable; urgency=low%n%n * %s%n%n --
%an <%ae> %aD%n%n' />
</exec>
Continuous Improvement in PHP Projects I Mayflower GmbH I 25th February I 75
80. ant deb (IV)
<concat destfile="debian/changelog">
<fileset
file="debian/changelog.new" />
<fileset
file="debian/changelog.old" />
</concat>
<delete file="debian/changelog.new" />
<delete file="debian/changelog.old" />
Continuous Improvement in PHP Projects I Mayflower GmbH I 25th February I 76
81. ant deb (V)
<exec executable="dpkg-buildpackage">
<arg value="-b" />
<arg value="-v${build.number}-$
{githash}" />
<arg value="-Zlzma" />
<arg value="-z9" />
<arg value="-k78532445" />
<arg value="-pgpg" />
<arg value="-sgpg" />
<arg value="-mMayflower Mapolis Team
<mapolis@mayflower.de>" />
</exec>
Continuous Improvement in PHP Projects I Mayflower GmbH I 25th February I 77
82. ant deb (VI)
<move todir="build/deb/">
<fileset dir="${basedir}/../">
<include name="mapolis*.deb" />
<include name="mapolis*.changes" />
</fileset>
</move>
<exec executable="dpkg-buildpackage">
<arg value="-Tclean" />
</exec>
</target>
Continuous Improvement in PHP Projects I Mayflower GmbH I 25th February I 78
83. Deploy Staging
ant clean
ant deb-sign
ant db-staging-up
scp to all hosts
Continuous Improvement in PHP Projects I Mayflower GmbH I 25th February I 79
84. Deploy Staging to live
scp to all hosts
Continuous Improvement in PHP Projects I Mayflower GmbH I 25th February I 80
85. Disadvantages and
problems
Continuous Improvement in PHP Projects I Mayflower GmbH I 25th February I 81
86. Build time
15 min on harddisk
massive disk i/o
4 min on ramdisk :-)
Continuous Improvement in PHP Projects I Mayflower GmbH I 25th February I 82
87. Complexity beginning such
a infrastructure
Continuous Improvement in PHP Projects I Mayflower GmbH I 25th February I 83
88. Jenkins:
Single point of failure!
Continuous Improvement in PHP Projects I Mayflower GmbH I 25th February I 84
89. Cool stuff
which is now possible
Continuous Improvement in PHP Projects I Mayflower GmbH I 25th February I 85
90. Deploy by customer. :-)
Continuous Improvement in PHP Projects I Mayflower GmbH I 25th February I 86
91. Jenkins Chuck Norris Plugin
Continuous Improvement in PHP Projects I Mayflower GmbH I 25th February I 87
92. git bisect start
$BAD $GOOD
Continuous Improvement in PHP Projects I Mayflower GmbH I 25th February I 88
93. Minimum time from
bugreport to deploy:
30 minutes
Continuous Improvement in PHP Projects I Mayflower GmbH I 25th February I 89
94. $ git branch hotfix-2011-08-22
$ git checkout hotfix-2011-08-22
$ git reset --hard "last stable sha-1"
$ git cherry-pick "hotfix sha-1"
$ echo build.number=23 > build.number
$ ant deb
$ scp build/deb/*.deb xyz.amazonaws.com:/
opt/repository/
$ git checkout master
$ git push origin hotfix-2011-08-10
Continuous Improvement in PHP Projects I Mayflower GmbH I 25th February I 90
95. Questions?
Continuous Improvement in PHP Projects I Mayflower GmbH I 25th February I 91