Deployment
Within a Traditional IT environment
Rob Allen
akrabat.com ~ @akrabat ~ November 2016
Slide 2
Slide 2 text
What?
Software deployment is all of the activities that make a
software system available for use.
Wikipedia
Rob Allen ~ @akrabat
Slide 3
Slide 3 text
Traditional IT environment
Rob Allen ~ @akrabat
Slide 4
Slide 4 text
Not in this talk
• Cloud deployments
• Provisioning of servers
• Continuous Delivery
• Chat Ops
Rob Allen ~ @akrabat
Slide 5
Slide 5 text
Fundamentals
Rob Allen ~ @akrabat
Slide 6
Slide 6 text
Development processes
Rob Allen ~ @akrabat
Slide 7
Slide 7 text
Code organisation
• Isolate work
• Work on branches
• Always have a way to bugfix live
Rob Allen ~ @akrabat
Slide 8
Slide 8 text
Feature branches
Rob Allen ~ @akrabat
Slide 9
Slide 9 text
Git flow
Rob Allen ~ @akrabat
Slide 10
Slide 10 text
Automatic testing
Automatically test every PR
• Coding style
• Unit tests
• Functional tests
• Acceptance tests
Rob Allen ~ @akrabat
Slide 11
Slide 11 text
DB schema management
Rob Allen ~ @akrabat
Slide 12
Slide 12 text
Migrations
• Schema changes stored in individual files
• delta files with UP and DOWN functionality
• It really doesn't matter which tool you use
Rob Allen ~ @akrabat
Slide 13
Slide 13 text
Configuration data
Rob Allen ~ @akrabat
Slide 14
Slide 14 text
Context awareness
Each instance needs different configuration
• Environment variables (12factor.net/config)
• Local configuration file
Rob Allen ~ @akrabat
Slide 15
Slide 15 text
Deployment
Rob Allen ~ @akrabat
Slide 16
Slide 16 text
Manual deployment
Simply copy the files to the right place
(S)FTP / rsync / Remote Desktop
Rob Allen ~ @akrabat
Slide 17
Slide 17 text
Manual deployment
• Slow
• Inconsistencies between each deploy
• Failures in production
• No records. Who deployed what, when (or where)?
Rob Allen ~ @akrabat
Slide 18
Slide 18 text
It's more than just code
Rob Allen ~ @akrabat
Slide 19
Slide 19 text
Other things to think about
• File permissions
• Preserve user uploaded files
• After upload
• Stale cache?
• Cache priming?
• Keeping records
Rob Allen ~ @akrabat
Slide 20
Slide 20 text
People aren't machines!
Rob Allen ~ @akrabat
Slide 21
Slide 21 text
Automation
People:
good at creative judgement
Machines:
good at doing the same thing over and over
Rob Allen ~ @akrabat
Scripts
• Provide consistency
• Provide a platform for additional abilities
• No need to wait for other people
• Faster and less hassle.
Rob Allen ~ @akrabat
Tooling
• Simple script
• Make-like tool
• Specialist tool
Rob Allen ~ @akrabat
Slide 26
Slide 26 text
Simple script
• Bash
• Powershell
• Usually runs on the server
Rob Allen ~ @akrabat
Slide 27
Slide 27 text
Make-like tool
• Abstracted script
• Easier to make cross platform
• Make/Phing/Ant/Rake
• More likely to push to server
Rob Allen ~ @akrabat
Slide 28
Slide 28 text
Specialist tools
• Fabric/Capistrano
• Ansible/Chef/Puppet/Salt
• Deploybot
• More likely to be automated
Rob Allen ~ @akrabat
Slide 29
Slide 29 text
Challenges
Rob Allen ~ @akrabat
Slide 30
Slide 30 text
Technical
Infrastructure challenges
• Platform
• Permissions
Rob Allen ~ @akrabat
Slide 31
Slide 31 text
Political
• What is acceptable?
• What are you allowed to do?
• Does IT change things for you?
• Does IT change things unexpectedly?
• Change request documentation?
Rob Allen ~ @akrabat
Slide 32
Slide 32 text
Case studies
Rob Allen ~ @akrabat
Slide 33
Slide 33 text
Case study 1: Internal
• Self-hosted by client
• Within company network
• Windows/IIS/SQL Server
Rob Allen ~ @akrabat
Slide 34
Slide 34 text
Case study 1: Internal
Multi-script solution
1. Script to tag code & build tarball
2. Ship tarball to UAT server via VPN
3. IT copy tarball from UAT to Live
4. Script to untar & run deploy steps
Rob Allen ~ @akrabat
Slide 35
Slide 35 text
Case study 2: Minicomputer
• Self-hosted by client
• Some access to Internet
• IBM i-series/DB2
Rob Allen ~ @akrabat
Slide 36
Slide 36 text
Case study 2: Minicomputer
• CI tooling
• Checklist
• Manual tag creation for release
• Automatic script to deploy
Rob Allen ~ @akrabat
Slide 37
Slide 37 text
Final thought
Rob Allen ~ @akrabat
Slide 38
Slide 38 text
Rob Allen ~ @akrabat
Slide 39
Slide 39 text
Thank you!
Feedback: http://oreil.ly/2f2vuCH
Rob Allen ~ akrabat.com ~ @akrabat