Daniel Pötzinger
CIO AOE media GmbH
What is your
               cycle
time?
are youscared
     on release days?
late night
bugfixing?
there is another
way!
How?
Automate everything!
Automate everything!
   build
Automate everything!
   build
   test
Automate everything!
   build
   test
   deploy
Do it frequently
Do it frequently



              ys 3
           plo .
         de
  fl ickr a day..
    tim es
agile


   agile


        agile

   continuous deployment
agile development best practice:
              agile
 test driven / refactoring / ddd


                agile


                     agile

                 continuous deployment
agile development best practice:
              agile
 test driven / refactoring / ddd


             agile
     continuous integration


                     agile

                 continuous deployment
agile development best practice:
              agile
 test driven / refactoring / ddd


             agile
     continuous integration


                   agile
            continuous testing


                 continuous deployment
It is not only the
source code!
It is not only the
source code!


         What else?
Source Code
Configuration



               Source Code
Environments



Configuration



               Source Code
Environments



Configuration                  Data


               Source Code
Principle
s
Check everything into SVN
Check everything into SVN

•   all source code (of course)

•   each build script

•   each important configuration
    (apache, cronjobs, loadbalancer...)
do continuous integration
do continuous integration



      t ea rly
    mi
com it often
co mm
do continuous integration



       t ea  rly
    mio ten
  om av tid f
c      i o bra
co mm            nch
                    ing
do continuous integration



       t ea  rly
     mio ten
  om av tid f omprehen     sive
c      i o brc
c o mm          anctestsuite
                   hing
do continuous integration



       t ea  rly
    mio ten
  om av tid f omprehen fastsive
c      i o brc
   mm           anctestsuite    feed
co                 hing              back
use test automation...
use test automation...
use test automation...
use test automation...
use test automation...
use test automation...
use test automation...

     ...and feel responsible
automate deployment
automate deployment




            sa me
        the
    loy every
dep
  wa  y to ent!
    nvir onm
  e
automate deployment




            sa me
        the
    loy every
dep                 do it frequently
  wa  y to ent!
    nvir onm
  e
automate deployment


              adjust
         c onfigurations
         on deploy time
             sa me
        the
    loy every
dep      o            do it frequently
  w  ayt        nt!
       iron me
  env
automate deployment


               adjust
          c onfigurations
                     ./deme
          on de<e y ti ploy.s
                 plo
                     nviro      h
                  < ep    nme
         the  sam ack          nt>
       y                   age>
de plo       ev ery        do it frequently
      yt  o
   w a       me  nt!
   env  iron
Plan and test rollback
The
Deployme
nt Pipeline
deployment pipeline


                test + build
                  package
test strategy




                verification 1


                verification II

                release to
                production
deployment pipeline


                test + build
                  package
                                 Version 1
test strategy




                verification 1


                verification II

                release to
                production
deployment pipeline


                test + build
                  package
test strategy




                verification 1
                                 Version 1
                verification II

                release to
                production
deployment pipeline


                test + build
                  package
test strategy




                verification 1


                verification II
                                 Version 1
                release to
                production
deployment pipeline


                test + build
                  package
                                             Version 2
test strategy




                verification 1


                verification II
                                 Version 1
                release to
                production
deployment pipeline


                test + build
                  package
test strategy




                verification 1
                                             Version 2
                verification II
                                 Version 1
                release to
                production
deployment pipeline


                test + build
                  package
                                                         Version 3
test strategy




                verification 1
                                             Version 2
                verification II
                                 Version 1
                release to
                production
deployment pipeline
               Build Source (SVN, Backups)


     Commit
      Stage


Version_1234




                Artifacts Repository
deployment pipeline
                      Build Source (SVN, Backups)

                      Acceptance
     Commit    auto   Test Stage
      Stage             (latest)



Version_1234




                       Artifacts Repository
deployment pipeline
                      Build Source (SVN, Backups)

                      Acceptance
     Commit    auto   Test Stage
      Stage             (latest)



Version_1234




                       Artifacts Repository
deployment pipeline
                      Build Source (SVN, Backups)

                      Acceptance      Performance
     Commit    auto   Test Stage auto      Test
      Stage             (latest)          Stage



Version_1234




                       Artifacts Repository
deployment pipeline
                      Build Source (SVN, Backups)

                      Acceptance      Performance
     Commit    auto   Test Stage auto      Test
      Stage             (latest)          Stage


                               manual
                                        Manual Test
Version_1234                              Stage




                       Artifacts Repository
deployment pipeline
                      Build Source (SVN, Backups)

                      Acceptance      Performance
     Commit                                                    Release
               auto   Test Stage auto      Test       manual
      Stage             (latest)          Stage                 Stage


                               manual
                                        Manual Test
Version_1234                              Stage




                       Artifacts Repository
deployment pipeline
                      Build Source (SVN, Backups)

                      Acceptance      Performance
     Commit                                                     Release
               auto   Test Stage auto      Test        manual
      Stage             (latest)          Stage                  Stage


                                manual
                                         Manual Test
Version_1234                               Stage

                              Build Downstream



                       Artifacts Repository
deployment pipeline
                      Build Source (SVN, Backups)

                      Acceptance      Performance
     Commit                                                     Release
               auto   Test Stage auto      Test        manual
      Stage             (latest)          Stage                  Stage


                                manual
                                         Manual Test
Version_1234                               Stage

                              Build Downstream
                                 Feedback

                       Artifacts Repository
view on artifact repository
the commit stage


•   <5min: Run Unit Tests asap

•   <10 min: Build Project (clean, build)

•   Result:

         •    store all binaries required for deployment

         •    package + releasenotes + unittest xml + deploy scripts
build only one package


•   pull configuration setting for environment on deploy

•   be able to rebuild any build by specifying the project revision
acceptance stage
acceptance stage

• Define   tests in domain specific language
acceptance stage

• Define   tests in domain specific language

• Deployment   to Environment „latest“ or „UAT“
acceptance stage

• Define    tests in domain specific language

• Deployment     to Environment „latest“ or „UAT“

• Run   additional Unit-Test (integration...)
acceptance stage

• Define    tests in domain specific language

• Deployment     to Environment „latest“ or „UAT“

• Run   additional Unit-Test (integration...)

• Run   Selenium Tests
Release
Source Code
Configuration



               Source Code
Environments



Configuration



               Source Code
Environments



Configuration                  Data


               Source Code
SVN structure for TYPO3

<projectname>
 branches
 tags
                   build scripts (ant)
 trunk
   build
   scripts
   htdocs
     typo3conf   Extensions dependencies
                          are linked
                     (e.g. svn.external)
TYPO3 configuration

- Domains:
  - sys_domain
  - template: config.baseUrl
- localconf.php
  - Database
  - Extensionsettings
  - Loglevel / Devcontext / Logfiles ...
Environments (example)
 dev x    latest   test (UAT)




                   production
Environments (example)
 dev x    latest   test (UAT)


                   performance




                   production
Environments (example)
 dev x    latest   test (UAT)


                   performance


                   integration


                   production
Environments (example)
 dev x    latest     test (UAT)


                     performance


                     integration


             stage   production
managing data
managing data




Production:
- Content
- Transaction data
managing data




Production:          Deploy:
- Content            - Configuration
- Transaction data   - Content
managing data




Production:          Deploy:          UAT:
- Content            - Configuration   - Testdata
- Transaction data   - Content
managing data
                                      Backupstorage




Production:          Deploy:             UAT:
- Content            - Configuration      - Testdata
- Transaction data   - Content
managing data
                                      Backupstorage




Production:          Deploy:             UAT:
- Content            - Configuration      - Testdata
- Transaction data   - Content
managing data
                                      Backupstorage




   use independent technical IDs


Production:          Deploy:             UAT:
- Content            - Configuration      - Testdata
- Transaction data   - Content
Hot Deployment
what to deploy?

-   database structure changes
-   configuration data
-   updated content
-   source code
build steps
Preparation       SVN


Filesystem
              backupstorage


Database



Package
build steps
Preparation:
- clean
- revision Tag extensions
build steps

Filesystem:
- checkout project from SVN
- build TYPO3 source
- get defined extensions
- get assets (fileadmin / uploads)
- create a version file
build steps
Database:
- create structure from Master
- import master data
- update database structure
- import data from the systems
- merge data
build steps
Database:
- create structure from Master
- import master data
- update database structure
- import data from the systems
- merge data


                                 structure_up.sql
                                       merge.sql
package

Package (Delta):
- use files from build process
+ create filesystem delta
+ tar.gz all the stuff
deploying a package
- Deploy Database:
  - structure_up.sql
  - merge.sql
  - all full-*.sqls
- Deploy Filesystem
- Apply environment Settings
- Clear Cache
- Run Crawler
...
useful extensions

- clearcache      (enables „clear all cache“ from
commandline)

- db_sequenzer           (seperate technical ids as basis for
merges)

- t3deploy     (cli access to installtool > database compare)
green / blue deployment


   current live
     version
                  previous live
                    version
green / blue deployment


   current live
     version
                  previous live
                    version
                                  Deploy
green / blue deployment


                  previous live
                    version
   current live
     version
                                  Deploy
Hudson
Hudson
Hudson
Hudson
is your deployment still a
         gamble?
is your deployment still a
         gamble?

Continuous deployment

Editor's Notes

  • #3 cycle time = time a change in your code takes to be deployed on live (in a reliable (includes testing) and repeatable way) reduced cycle time = improved competitive
  • #6 (thats not me :-)
  • #22 without CI the default state of your application is &amp;#x201E;broken&amp;#x201C; unless you prove otherwise... with COIN the project default state is working with a certain level of confidence...
  • #23 without CI the default state of your application is &amp;#x201E;broken&amp;#x201C; unless you prove otherwise... with COIN the project default state is working with a certain level of confidence...
  • #24 without CI the default state of your application is &amp;#x201E;broken&amp;#x201C; unless you prove otherwise... with COIN the project default state is working with a certain level of confidence...
  • #25 without CI the default state of your application is &amp;#x201E;broken&amp;#x201C; unless you prove otherwise... with COIN the project default state is working with a certain level of confidence...
  • #107 Hudson + Plugins gives you a lot of possibilities (e.g. &amp;#x201E;promoted builds&amp;#x201C; &amp;#x201E;parameterized build&amp;#x201C;, &amp;#x201E;build downstreams&amp;#x201C;, share properties ...)
  • #108 Hudson + Plugins gives you a lot of possibilities (e.g. &amp;#x201E;promoted builds&amp;#x201C; &amp;#x201E;parameterized build&amp;#x201C;, &amp;#x201E;build downstreams&amp;#x201C;, share properties ...)
  • #109 Hudson + Plugins gives you a lot of possibilities (e.g. &amp;#x201E;promoted builds&amp;#x201C; &amp;#x201E;parameterized build&amp;#x201C;, &amp;#x201E;build downstreams&amp;#x201C;, share properties ...)