©2014
Elisabeth Hendrickson
Using PaaS for Continuous Delivery
Spoiler
Cloud Foundry is perfect for
Continuous Delivery.
The hard part about Continuous
Delivery probably isn’t your deployment
infrastructure.
What is CI?
Hint: it’s not a server
Culture Change: Stop the Line
If just one single test out of thousands fails, the whole build failed.
We stop the line and fix the issue.
What is CD?
Hint: it’s not just a lot of CI
Continuous Delivery Defined
Continuous delivery means
that your software is
production-ready from day
one of your project (even
when it's not "feature
complete") and that you can
release to users on demand at
the push of a button.
– Jez Humble
“
Preconditions
• Fully automated tests at unit / integration /
system levels
• Continuous integration infrastructure
• Scripted, automated deployment to each
needed environment
From Build to Pipeline
Deploy
Config A
to Test
Env A
Deploy
Config B
to Test
Env B
Unit Tests
System
Tests
System
Tests
Promote
checkin
Culture Changes: Overcoming Resistance
What do you
mean there’s
no manual QA
phase?
Deliver half-
done
features?
Can’t possibly
work.
What’s the
point?
Customers
don’t want
stuff that fast
anyway.
Automation is
expensive.
(Yes, change is hard.)
All checking is
automated.
Develop in slices.
Aim for MVP. Try
feature flags.There is a
strategic
advantage in
being
continuously
deliverable even
if you don’t ship.
Error-prone manual
processes are more
expensive.
(Try TDD.)
CD with Cloud Foundry
Cloud Foundry Supports CD
• Promotion path: environment variables
support running identical code in test and
prod environments
• Automated deploys: cf v6 is scriptable
• Zero-downtime deploys: the blue/green
deploy pattern
Promotion: Same Code, Different Space
Testing Space
Your App
Promote*
“Automated Promotion” isn’t a feature yet. You can automate
promotion in your build pipeline with the cf cli.
*
Production Space
Your App
Test DB Production DB
Connect to the DB with
VCAP_SERVICES
Zero Downtime: Blue/Green Deploys
http://docs.cloudfoundry.org/devguide/deploy-apps/blue-green.html
app-green
stopped
app-blue
started
app-green
started
app-blue
stopped
v2
v3
push new code to app-green
stop blue, start green
app-green
stopped
app-blue
started
v2
v1
v3
v2
Example: Cloud Foundry Docs
What About the Automated
Tests?
Sorry, Cloud Foundry
can’t help you there.
But it can get deployment
and configuration yaks out
of your way so your team
can focus on the hard
things that only they can
solve.
Hint: there are still no magic bullets.
©2014
Elisabeth Hendrickson, @testobsessed
Thank You!

Using PaaS for Continuous Delivery (Cloud Foundry Summit 2014)

  • 1.
  • 2.
    Spoiler Cloud Foundry isperfect for Continuous Delivery. The hard part about Continuous Delivery probably isn’t your deployment infrastructure.
  • 3.
    What is CI? Hint:it’s not a server
  • 4.
    Culture Change: Stopthe Line If just one single test out of thousands fails, the whole build failed. We stop the line and fix the issue.
  • 5.
    What is CD? Hint:it’s not just a lot of CI
  • 6.
    Continuous Delivery Defined Continuousdelivery means that your software is production-ready from day one of your project (even when it's not "feature complete") and that you can release to users on demand at the push of a button. – Jez Humble “
  • 7.
    Preconditions • Fully automatedtests at unit / integration / system levels • Continuous integration infrastructure • Scripted, automated deployment to each needed environment
  • 8.
    From Build toPipeline Deploy Config A to Test Env A Deploy Config B to Test Env B Unit Tests System Tests System Tests Promote checkin
  • 9.
    Culture Changes: OvercomingResistance What do you mean there’s no manual QA phase? Deliver half- done features? Can’t possibly work. What’s the point? Customers don’t want stuff that fast anyway. Automation is expensive.
  • 10.
    (Yes, change ishard.) All checking is automated. Develop in slices. Aim for MVP. Try feature flags.There is a strategic advantage in being continuously deliverable even if you don’t ship. Error-prone manual processes are more expensive. (Try TDD.)
  • 11.
  • 12.
    Cloud Foundry SupportsCD • Promotion path: environment variables support running identical code in test and prod environments • Automated deploys: cf v6 is scriptable • Zero-downtime deploys: the blue/green deploy pattern
  • 13.
    Promotion: Same Code,Different Space Testing Space Your App Promote* “Automated Promotion” isn’t a feature yet. You can automate promotion in your build pipeline with the cf cli. * Production Space Your App Test DB Production DB Connect to the DB with VCAP_SERVICES
  • 14.
    Zero Downtime: Blue/GreenDeploys http://docs.cloudfoundry.org/devguide/deploy-apps/blue-green.html app-green stopped app-blue started app-green started app-blue stopped v2 v3 push new code to app-green stop blue, start green app-green stopped app-blue started v2 v1 v3 v2
  • 15.
  • 16.
    What About theAutomated Tests? Sorry, Cloud Foundry can’t help you there. But it can get deployment and configuration yaks out of your way so your team can focus on the hard things that only they can solve. Hint: there are still no magic bullets.
  • 17.