bash

  • set -euo pipefail, and the pipeline exit code you assumed

    A shell pipeline reports the exit code of the last command, so mysqldump | gzip > file succeeds when the dump fails and the gzip writes nothing. pipefail…

  • wp –format=json is what makes the CLI scriptable

    Parsing the table output with awk works until a value contains a space, and every command takes a format flag that removes the question. –format=ids is the one…

  • Compose in CI, and the service the tests need

    The tests need MySQL and Redis, and CI gives you an empty machine. Service containers, where they differ from compose, and the readiness nothing does for you.

  • docker system df before docker system prune

    A development machine accumulates dangling layers, stopped containers and orphaned volumes, and none of it is visible until the disk fills. -a –volumes deletes the database volume of…

  • A quoted heredoc delimiter expands nothing

    A heredoc expands variables and command substitutions by default, which is convenient for a template and disastrous for anything containing a dollar sign belonging to another language. One…

  • A self-hosted runner, and what it is allowed to reach

    The hosted runner cannot reach the private network, which is the whole problem — and a runner inside it is a machine running other people’s code.

  • Moving a pipeline to a runner you do not own

    The CI server was a pet and the pipeline was a shell script nobody could read. A runner that assumes nothing is the point, and the cache is…

  • systemd-run for a one-off with a memory limit

    Running a large import by hand and taking the machine down with the OOM killer is a recurring way to turn a routine task into an incident. –scope…

  • Composite actions, before reusable workflows existed

    Five workflows repeating the same eight setup steps is five places to update, and reusable workflows do not exist yet — a composite action is what does. shell:…

  • Blue-green on one host is two sockets and a variable

    The pattern does not need two machines or a load balancer — two php-fpm pools and an nginx variable will do it, and the rollback becomes a config…