The Why And How Of Continuous Deployment
Continuous Deployment is a strategy for releasing software.
Strategies Categorised By Time
More Irregular <------------ -------------> More regular
Once per iteration Every Month Two weeks 1 week Few days Nightly
[<========= Waterfall =========>]
[<=========== Agile ==========>]
[ BAU/firefighting/noprocess ]
Strategies Categorised By Time
More Irregular <------------ -------------> More regular
Once per iteration Every Month Two weeks 1 week Few days Nightly
[<========= Waterfall =========>]
[<=========== Agile ==========>]
[ BAU/firefighting/noprocess ]
TOO SLOW
- Even nightly is not responsive enough in many cases
- Vulns
- Urgent/Important fixes
- If too slow, every release is a nightmare
- Delays cause inefficiencies
- Merge hell
- Wasted code/time
Releases are a point of friction
The larger the friction, the more the project struggles.
Continuous Deployment
Commit Deploy
- Small commits
- All commits!
- No feature branches
- Hide "in progress" work with feature flags
Feature Flags (Flippers/Toggles)
- "Feature branching in code"
- Can be as complex as you want
- "Dark launch"
- Enable for admins only; (random?) list of users; user cohort
- Enable after certain date
- Built-in kill switches
- Continuous Integration (poorman: manual)
- Should complete quickly
- When they fail, the impending deployment is abandoned
- Triggered by a successful run of the tests (poorman: manual)
- As few commands as possible! Should be frictionless
- Should be no cause for fear
What Happens If Things Break?
- Should always be possible to roll back to the previous commit
- The smaller the changes, the easier this is
- Write a test to cover the break
- Strategy assumption: "Every Defect Once"
- CD is actually a risk reduction strategy
- Presupposes what you're doing now is working ;)
- Going slower reduces frequency of risk, but massively increases magnitude
- More responsive
- Solid incentive to develop good testing habits
- Less pressure
- Less waste
- Improved developer attitude
CD lets you go fast with confidence
- "I work for a financial institution, and..."
- Your problem is the test suite, not CD
- "You're outsourcing QA to your customers!"
- You can still involve QA - deploy to a staging environment simultaneously, and/or give them access to new features on production with feature flags
- You already outsource QA to your customers to an extent ;)
- "Batching up changes is safer"
- Waiting longer does not correlate with higher quality
- Other eyes checking does - which you can do without batching changes
- "We'd never get signoff for this"
- "We're losing millions" almost never goes through signoff either
- "Legislation forbids us from..."
- Devs change stuff all the time, in violation of legislation! See previous point
- Some dev always has root access
- "GST goes up to 15% on XXX..."
- Manage dependency issues with feature flags
- "Our tests now take hours to run!"
- "That's all good for you SaaS guys, but..."
- CD has significant mindshare in the tech startup community
- Major players are already adopting it
- You will be left behind - nobody who has switched switches back
- Try it on a small/new project to test the concept in your mind
Credits
- Thx Andy for the slides
- Thx Grant for the prod