The bakery/delivery pattern

Jack Stevenson
2 min readMar 24, 2017

A short blog that Donal Spring and I paired on.

The bakery/delivery pattern can be established in minutes to automate the creation of immutable images (the bake), and deployment of said images to your cloud (the deliver).

Get your favourite automation tool to do all the hard work when a developer pushes to remote, whether this be Jenkins notified via your git repo over webhooks, TravisCI, BitBucket Pipelines, or GitLabCI. The pattern is tech agnostic, so get cooking!

Let’s tour the pipeline. Remember that you can plug-in additional stages to tailor to your teams preference.

a) Throw the ingredients into the mixer and check the composition with your favourite build runner, whether this be webpack/grunt/gulp/npm/gradle/maven/whatever. Build and run some tight feedback verification like functional UI-API-E2E tests, static code analysis, isolated regression tests, early performance tests and even check your dependencies for any nasty security vulnerabilities or license issues.

b) Everything look great? Cool! Throw the dough into straight into oven, building an immutable image using your favourite container tech, most likely Docker right? Brand (tag) the goods with your git SHA for traceability, and upload to your favourite image registry. Rerun those verification tests and maybe a few more to make sure all is well, and we’ve got ourselves a candidate for mass production.

c) Get it out there for a taste testing using your favourite container management solution, whether that be Kubernetes, Docker Swarm or Mesos. Get some analytic instrumentation in place at the UI/API level to give your team feedback on the goods. Maybe you’re not totally ready to rollout across the board, so do a little dynamic rolling out across your landscape as confidence levels increase! For bonus points rollout automatically based on analytics such as low error rate and positive user experience/behaviour feedback.

--

--