Automating the build and deployment of legacy applications

21
Automating the build and deployment of legacy applications The CWC experience

Transcript of Automating the build and deployment of legacy applications

Page 1: Automating the build and deployment of legacy applications

Automating the build and deployment of legacy applications

The CWC experience

Page 2: Automating the build and deployment of legacy applications

Steve JuddSystems Architect at CWC

Cable & Wireless CommunicationsFull service Telco (fixed, mobile, broadband, TV)Main businesses in Caribbean & Panama

Page 3: Automating the build and deployment of legacy applications

Background

Page 4: Automating the build and deployment of legacy applications

• N-tier application: ‘Liberate’

• Installed in multiple Business Units, on multiple environments

• Several releases are actively supported

The Application....

Page 5: Automating the build and deployment of legacy applications

Challenges...

• 2 Version Control Systems:– Subversion for Java tiers– CMS for the Cobol code

• Each tier has its own build/deploy tools

• Many manual steps• Much co-ordination required• Dependency on highly

knowledgeable people• Equals risky, stressful, labour-

intensive releases• And finally…. CWC HQ is moving

to Miami this year

Page 6: Automating the build and deployment of legacy applications

Objectives...

• Significantly reduce manual effort

• Simplify & streamline build & deploy process

• Remove dependency on VMS skills & highly knowledgeable people

• Migrate to one VCS• All to be completed by

June!

Page 7: Automating the build and deployment of legacy applications

Approach

Page 8: Automating the build and deployment of legacy applications

Some theory...• Useful books:

– “Continuous Delivery” by Jez Humble & David Farley

– “Jenkins - The Definitive Guide” by John Ferguson Smart

• Both contain useful ideas and approaches

However….• Daunting to apply these to a

traditional development shop...

• … with a large, complex legacy application

Page 9: Automating the build and deployment of legacy applications

What to do, what to do...• Migration to a single VCS +

formally define the branching strategy

• Selection & adoption of a single tool to manage generation of application binaries

• Selection & adoption of a single tool to manage deployment

Page 10: Automating the build and deployment of legacy applications

Our build/deploy pipeline...

Responsibility of Dev teamsUnit testingFunctional testingCommit to VCS

Compilation & generation of binariesRun any automated testsStatic code analysisGenerate Javadocs

Push binaries to Deployment server

Package binaries into environment specific deployables

Actual deployment mechanism

Page 11: Automating the build and deployment of legacy applications

Version Control

Page 12: Automating the build and deployment of legacy applications

Subversion...• Our VCS of choice• Why?– Reliable– Straight-forward to understand

& use– Good set of client tools– ...can even use under VMS!– Optimistic locking model

• Does mean we’ll be migrating our Cobol source though• Also need to change VMS development environment

Page 13: Automating the build and deployment of legacy applications

Branching strategy

• Branch for latest development release (aka trunk)

• Branch for each major release (3,4,5 etc)

• Branch for each release build in a BU production environment

• 3 Subversion repositories: one for each application

• Standardise the branch naming convention

Page 14: Automating the build and deployment of legacy applications

Subversion: lessons learnt• Merging – do it often &

check every merged file• Meaningful commit

messages• Using a VCS to store binary

libraries can be a bad thing• More small repos better

than fewer large

Page 15: Automating the build and deployment of legacy applications

Building binaries

Page 16: Automating the build and deployment of legacy applications

Binary generation• Jenkins is our Build Server of choice• Why we like it:

– Familiar technology– Integrates well with Subversion & Ant– Extensive library of plugins– Straight-forward to use/configure– Master/slave model– Ability to invoke scripts on a remote host

Page 17: Automating the build and deployment of legacy applications

Plugins we use• Build Pipeline

– provides a view of upstream & downstream jobs

• Copy Artifact– Enables artifacts to be copied from another job– We use it a lot with Build Pipeline

• Text-findr– Searches for specified text in files & console output– Handy when scripts’ return code not sent back to Jenkins

Page 18: Automating the build and deployment of legacy applications

Deployment

Page 19: Automating the build and deployment of legacy applications

Our requirements• Complex deployment needs:

– Multiple Business Units– Each has a production environment + 1

or more UAT environments– Business Units often on different releases– Many system test environments

• Thus keeping track of what release where is important

• Management of Application Configuration

• 2 phase deployments• Able to deploy to Linux, Windows and

VMS

Page 20: Automating the build and deployment of legacy applications

Why we chose DeployIt• It meets our requirements • Dictionaries for the configuration values• Handles Linux, Windows and VMS deployments• Release Dashboards• Composite packages for multi-app deployments• Custom plugin for 2 phase deployments• Only transfers packages that have changed

Page 21: Automating the build and deployment of legacy applications