Free lesson · Module 1, lesson 1 of 7

What happens after the code is written

Follow one change to a college app from a developer's laptop to a student's phone, and name the seven stages it passes: build, test, package, store, deploy, run and watch.

Lessons in this module

Lesson notes

For the student

One change, a fix to the exam form notice, passes seven stages before it reaches a student's phone. Each stage takes what the stage before it made, hands its own output on, and can stop a bad change. Nothing to install for this lesson.

The seven stages and what comes out

  • Build: the code becomes a program that runs; out comes a build
  • Test: automatic checks run against the build; out comes a test result, pass or fail
  • Package: the build and everything it needs are sealed together; out comes an image
  • Store: the image is kept in a registry that servers can reach; out comes a stored image
  • Deploy: the servers fetch the image and swap the old version for the new; out comes the new version, running
  • Run: the service keeps answering requests; out comes a service that stays up
  • Watch: numbers and alerts on the running service; out come graphs, and alerts to the team
  • When the stages run by themselves, one after another, the chain is called a pipeline

Each stage is a gate

  • A failed stage stops the change: nothing after it runs, and students never see it
  • A bug caught at test costs minutes; the same bug found by students costs a wrong notice on every phone and a second release
  • A hand fix on the live server is undone by the next normal release, which deploys the stored image without it
  • Running is not measuring: only watching tells the team about a slow page before students do

Say it in one sentence

  • Make it, check it, box it, keep it, send it, run it, watch it
  • For any event, ask what came in and what came out: an image in and a registry copy out is store; an old version out and a new one in is deploy
  • Interview: "What happens after a developer pushes code?" It is built, tested, packaged into an image, stored in a registry, deployed, run and watched, and each stage can stop a bad change before users see it

Try it

  • Worksheet task 1 in labs/m01/README.md: a change to the college fee page. Write the seven stages it passes and what comes out of each
  • You should have a table of seven rows, from build to watch, each with its output

Lesson quiz

Checked in your browser. Nothing is sent or saved.

5 questions

Question 1 · easy

In what order does a change pass the seven stages?

Question 2 · easy

What comes out of the package stage?

Question 3 · medium

A change builds and its tests pass, but the package stage fails. Which stages run after it?

Question 4 · medium

After a release, 3 percent of requests to the notice board start failing. Which stage should tell the team before students complain?

Question 5 · hard

A wrong date is live, and someone fixes it by hand on the live server tonight. What happens at the next normal release?

Next: DevOps: a way of working, not a tool