All jobs / DevOps / SRE / cloud / Linux

DevOps / SRE / cloud interview question · 1–3 years

A deploy script failed on step two (the build), carried on, and pushed an empty artifact to production.

What do you change in the script?

The strongest answer

Start it with `set -euo pipefail` so a failed command, an unset variable or a failed pipeline stage stops the script, and quote every variable expansion

Why it works

Exactly — -e stops on error, -u catches typos in variable names, pipefail stops a pipeline hiding a failure. It is the first line of every serious script.

What a good answer covers

Answers that fall short

Who gets asked this

More Linux questions