deployment - akrabat.com

39
Deployment Within a Traditional IT environment Rob Allen akrabat.com ~ @akrabat ~ January 2017

Upload: others

Post on 31-Jan-2022

3 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Deployment - akrabat.com

DeploymentWithin a Traditional IT environment

Rob Allen  

akrabat.com ~ @akrabat ~ January 2017

Page 2: Deployment - akrabat.com

What?Software deployment is all of the activities that make asoftware system available for use.

Wikipedia

Rob Allen ~ @akrabat

Page 3: Deployment - akrabat.com

Traditional IT environment

Rob Allen ~ @akrabat

Page 4: Deployment - akrabat.com

Not in this talk• Cloud deployments• Provisioning of servers• Continuous Delivery• Chat Ops

Rob Allen ~ @akrabat

Page 5: Deployment - akrabat.com

Fundamentals

Rob Allen ~ @akrabat

Page 6: Deployment - akrabat.com

Development processes

Rob Allen ~ @akrabat

Page 7: Deployment - akrabat.com

Code organisation• Isolate work• Work on branches• Always have a way to bugfix live

Rob Allen ~ @akrabat

Page 8: Deployment - akrabat.com

Feature branches

Rob Allen ~ @akrabat

Page 9: Deployment - akrabat.com

Git flow

Rob Allen ~ @akrabat

Page 10: Deployment - akrabat.com

Automatic testingAutomatically test every PR

• Coding style• Unit tests• Functional tests• Acceptance tests

Rob Allen ~ @akrabat

Page 11: Deployment - akrabat.com

DB schema management

Rob Allen ~ @akrabat

Page 12: Deployment - akrabat.com

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

Page 13: Deployment - akrabat.com

Configuration data

Rob Allen ~ @akrabat

Page 14: Deployment - akrabat.com

Context awarenessEach instance needs different configuration

• Environment variables (12factor.net/config)• Local configuration file

Rob Allen ~ @akrabat

Page 15: Deployment - akrabat.com

Deployment

Rob Allen ~ @akrabat

Page 16: Deployment - akrabat.com

Manual deploymentSimply copy the files to the right place(S)FTP / rsync / Remote Desktop

Rob Allen ~ @akrabat

Page 17: Deployment - akrabat.com

Manual deployment• Slow• Inconsistencies between each deploy• Failures in production• No records. Who deployed what, when (or where)?

Rob Allen ~ @akrabat

Page 18: Deployment - akrabat.com

It's more than just code

Rob Allen ~ @akrabat

Page 19: Deployment - akrabat.com

Other things to think about• File permissions• Preserve user uploaded files• After upload

• Stale cache?• Cache priming?

• Keeping records

Rob Allen ~ @akrabat

Page 20: Deployment - akrabat.com

People aren't machines!

Rob Allen ~ @akrabat

Page 21: Deployment - akrabat.com

AutomationPeople:

good at creative judgementMachines:

good at doing the same thing over and over

Rob Allen ~ @akrabat

Page 22: Deployment - akrabat.com

Benefits• Deferred deployments• Self-service deployments• Automatically triggered deployments• Smoke tests• Automatic rollbacks

Rob Allen ~ @akrabat

Page 23: Deployment - akrabat.com

Scripts• Provide consistency• Provide a platform for additional abilities• No need to wait for other people• Faster and less hassle.

Rob Allen ~ @akrabat

Page 24: Deployment - akrabat.com

Deployment checklist• Copy files & folders• Database schema & content updates• Configuration updates• File permissions• Clear caches

Rob Allen ~ @akrabat

Page 25: Deployment - akrabat.com

Tooling• Simple script• Make-like tool• Specialist tool

Rob Allen ~ @akrabat

Page 26: Deployment - akrabat.com

Simple script• Bash• Powershell• Usually runs on the server

Rob Allen ~ @akrabat

Page 27: Deployment - akrabat.com

Make-like tool• Abstracted script• Easier to make cross platform• Make/Phing/Ant/Rake• More likely to push to server

Rob Allen ~ @akrabat

Page 28: Deployment - akrabat.com

Specialist tools• Fabric/Capistrano• Ansible/Chef/Puppet/Salt• Deploybot• More likely to be automated

Rob Allen ~ @akrabat

Page 29: Deployment - akrabat.com

Challenges

Rob Allen ~ @akrabat

Page 30: Deployment - akrabat.com

TechnicalInfrastructure challenges• Platform• Permissions

Rob Allen ~ @akrabat

Page 31: Deployment - akrabat.com

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

Page 32: Deployment - akrabat.com

Case studies

Rob Allen ~ @akrabat

Page 33: Deployment - akrabat.com

Case study 1: Internal• Self-hosted by client• Within company network• Windows/IIS/SQL Server

Rob Allen ~ @akrabat

Page 34: Deployment - akrabat.com

Case study 1: InternalMulti-script solution

1. Script to tag code & build tarball2. Ship tarball to UAT server via VPN3. IT copy tarball from UAT to Live4. Script to untar & run deploy steps

Rob Allen ~ @akrabat

Page 35: Deployment - akrabat.com

Case study 2: Minicomputer• Self-hosted by client• Some access to Internet• IBM i-series/DB2

Rob Allen ~ @akrabat

Page 36: Deployment - akrabat.com

Case study 2: Minicomputer• CI tooling• Checklist

• Manual tag creation for release• Automatic script to deploy

Rob Allen ~ @akrabat

Page 37: Deployment - akrabat.com

Final thought

Rob Allen ~ @akrabat

Page 38: Deployment - akrabat.com

 

Rob Allen ~ @akrabat

Page 39: Deployment - akrabat.com

Thank you!    

Rob Allen ~ akrabat.com ~ @akrabat