CI/CD is FREEDOM
William Wallace, one of the principal leaders of the first war of Scottish independence, as depicted by Mel Gibson in Braveheart (1995)

CI/CD is FREEDOM

I post about three general areas that I am passionate about: systems engineering as it applies to organization design; excellence in software engineering practices; and, delivering great product to nail the user's and the business's needs. This post is about software engineering. Enjoy!

Act 1 - Setup

Picture, if you will, a Scotsman. Big, strong, hairy, pungent, and bent on independence for Scotland. Picture him sitting astride a great stallion, addressing a horde of assembled men ready to take on an English army.

Aye, fight and you may die. Run and you'll live -- at least a while. And dying in your beds many years from now, would you be willing to trade all the days from this day to that for one chance, just one chance to come back here and tell our enemies that they may take our lives, but they'll never take our CI/CD!!!

You might think that Mel Gibson, in portraying this scene in the 1995 blockbuster Braveheart, took some artistic license with William Wallace's enthusiasm for CI/CD. However, you would be mistaken in this position. Had Wallace in fact been a 21st-century DevOps practitioner, I am certain that he would have understood the vitally important value that CI/CD brings to our lives.


The picture below is an automated build light. A physical build status indicator, mounted on an office wall, connected to a CI/CD build system such that "green" represents a healthy build, and "red" represents an unhealthy "failed" build.

Five coloured triangle-shaped lights, arranged in a hexagon. Two lights are green and three are red. Incidentally, they are arranged to suggest Pacman chasing some ghosts. LOL.
Build lights, showing three "red" builds and two "green" builds.

How does this picture make you feel? Does it give you the heebie-jeebies? If so, you might identify with some of what I am about to say.

Act 2 - Confrontation

What is CI/CD?

CI/CD stands for Continuous Integration/Continuous Deployment. It is implemented in standalone CI/CD systems like TeamCity and Jenkins, and is a key feature of broader DevOps delivery platforms like MS DevOps, GitHub, BitBucket.

CI/CD does a couple of important things.

Short Feedback Cycle

You know quickly if you broke it

Let's start with the big one. When you have a functional CI/CD system, you are informed quickly when something is broken. A light goes red, and you know right away which change caused the failure. That is a quick feedback cycle. Because you just broke it, you know exactly what the cause is, and it should be quick to fix.

The thought may have occurred to you "wait, I can achieve that locally without CI/CD". And maybe you can, for a while. You can set up some scripts that everyone runs before committing a change, maybe. But, unfortunately, it's incredibly likely that at some point, the team will have a lapse in discipline, and some of your nice green tests will go red, and... nobody will care. CI/CD is a much more robust solution, because it makes the failure immediately visible when someone else broke something.

Psychological Safety

You're not nervous about breaking something you don't understand

Once you have this in place, coupled with adequate test coverage you know that you can confidently make a change to your system. If the light is green, your change is good. Or at least, you haven't broken something fundamental. This relieves or lessens any anxiety you or your team might otherwise have.

This is best achieved by configuring your CI/CD build to run on every branch.

Pre-Tested Commit

The unbreakable build

With adequate architectural design and test orchestration, the pre-tested commit (or "gated" commit) pattern can be used to ensure that any commit (or branch, or PR) that would fail the build never makes it to production. This works by configuring the CI/CD system to run the build to completion on a merge-candidate branch (or PR), and then automatically rebasing, (often) squashing, merging the result if and only if all tests pass (green status).


It Runs On My Machine

Few "Gotcha" Dependencies in your Build System

This one is more of a side-effect than anything else, but it's a nice convenient one. Your CI/CD build ought to run on a "vanilla" build agent with very few system-installed dependencies. That has the benefit that any new member introduced to your team can come along on day one, check out your code, and execute build.sh (or build.cmd), and successfully build the project without spending three days configuring their tools.


Other Build-Time Checks

There are a bunch of other things you can do at build time that can be automated and enforced in a CI/CD system.

  • Scan for security vulnerabilities in first-party components or third-party libraries.
  • Run an automatic "linter" to tidy up your code.
  • Perform any necessary regulatory or procedural checks enforced by your company.



Act 3 - Resolution

Just like Braveheart (1995), this story has a happy ending. By the time this article was published, all of the build lights were green again. This just goes to show how awesome a team of motivated, dedicated and productive engineers can be.

No alt text provided for this image
The same build lights pictured earlier, showing 5/5 green build lights.


Because remember:

they may take our lives, but they'll never take our CI/CD!!!


要查看或添加评论,请登录

Ben Ernst的更多文章

  • Do you know your TDD?

    Do you know your TDD?

    I post about three general areas that I am passionate about: Systems engineering as it applies to organization design…

    1 条评论
  • Autonomy is a critical differentiator in any knowledge-based enterprise.

    Autonomy is a critical differentiator in any knowledge-based enterprise.

    I post about three general areas that I am passionate about: Systems engineering as it applies to organization design…

    1 条评论
  • You're Getting More Value Out of Your User Feedback Than You Might Appreciate

    You're Getting More Value Out of Your User Feedback Than You Might Appreciate

    When you spend a lot of time engaging with your users and gathering feedback, sometimes you might come away feeling…

    2 条评论
  • Ditch the Daily Stand-Up

    Ditch the Daily Stand-Up

    The daily stand-up. Indispensable, right? Without that 15 minutes a day, how would we communicate about what we're…

  • Host your Passion Project (for free)

    Host your Passion Project (for free)

    When interviewing junior software engineers, one thing that makes a huge impression is when you have a hobby project to…

  • Conditionals Expressions Considered Harmful

    Conditionals Expressions Considered Harmful

    Use a Factory instead. How much simpler can code get than a humble if/else statement or a casual ternary expression? I…

社区洞察

其他会员也浏览了