Sign inSign up free

601. A Pipeline That Always Passes

medium 20 XP ~10 minHands-on lab

/home/student/repos/docs-site/ci.sh is the whole CI pipeline: it runs scripts/lint.sh, scripts/test.sh and scripts/build.sh. Last week a release shipped with failing tests, because the pipeline still exited 0.

Task

Fix ci.sh so that:

  • it runs the stages in order: lint, test, build,
  • it stops at the first stage that fails (later stages don't run) and exits with a non-zero code,
  • the test output is still shown on screen and saved to test.log in the repository (keep using tee),
  • it prints pipeline finished only when every stage passed, and then exits 0.

Don't change the scripts in scripts/. The grader runs your ci.sh from the repository root with stages it makes fail on purpose.

About this machine

Ubuntu 24.04 with no internet access. You are student with passwordless sudo. The grader checks the final state of the machine, not the commands you typed. Values like names and ports are generated for you.

Part of CI/CD Pipelines in Practice. Next step: Run CI on the Right Events

Teaching or writing about this? Embed this lab on your page

TerminalNot started

Your machine is ready to start

A fresh, isolated Ubuntu machine boots in a few seconds with the task already set up.

No account needed: 3 of 3 free tries left. Guest machines last 30 minutes.