Offer one-time Debian install for missing run.sh host dependencies #36

Merged
MHE merged 1 commit from run-sh-prompt-install-missing-deps into main 2026-11-10 13:27:30 +01:00
Owner

What changed

  • run.sh: when git, yq, rsync, envsubst, or docker is missing, the script now says so once and asks whether to install the matching Debian package (git, yq-go, rsync, gettext-base, docker-cli). The run continues after a successful install.
  • run.sh: a yq binary that is present but is not mikefarah v4 gets the same one-time offer for yq-go.
  • run.sh: the host-logrotate jq/logrotate offer and the new dependency checks share one helper set (apt_install_preflight, read_apt_install_confirmation, install_host_apt_package), so confirmation accepts y, yes, j, or ja.
  • run.sh: update_self_from_repo uses the same require_host_command git path instead of its own git check.
  • .openso/rules/20-scripts.md: documents the new behaviour. get-folder.sh still does not install packages and still errors on a missing command.

Why

Previously run.sh only reported missing or incompatible host tools and stopped, so operators had to install them by hand and re-run. The new flow offers the install once, in the same way host-logrotate already did, while keeping the existing rules: no install during --dry-run, none without a terminal, and the error stays if the operator declines.

Review notes

  • Installs run apt-get update then apt-get install -y <package>, as root or via the configured sudo binary.
  • Dry-run and non-interactive runs behave as before: an error that names the command, no install.
## What changed - `run.sh`: when `git`, `yq`, `rsync`, `envsubst`, or `docker` is missing, the script now says so once and asks whether to install the matching Debian package (`git`, `yq-go`, `rsync`, `gettext-base`, `docker-cli`). The run continues after a successful install. - `run.sh`: a `yq` binary that is present but is not mikefarah v4 gets the same one-time offer for `yq-go`. - `run.sh`: the host-logrotate `jq`/`logrotate` offer and the new dependency checks share one helper set (`apt_install_preflight`, `read_apt_install_confirmation`, `install_host_apt_package`), so confirmation accepts `y`, `yes`, `j`, or `ja`. - `run.sh`: `update_self_from_repo` uses the same `require_host_command git` path instead of its own `git` check. - `.openso/rules/20-scripts.md`: documents the new behaviour. `get-folder.sh` still does not install packages and still errors on a missing command. ## Why Previously `run.sh` only reported missing or incompatible host tools and stopped, so operators had to install them by hand and re-run. The new flow offers the install once, in the same way host-logrotate already did, while keeping the existing rules: no install during `--dry-run`, none without a terminal, and the error stays if the operator declines. ## Review notes - Installs run `apt-get update` then `apt-get install -y <package>`, as root or via the configured sudo binary. - Dry-run and non-interactive runs behave as before: an error that names the command, no install.
Offer to install missing host packages for run.sh dependencies
All checks were successful
ci / compose (pull_request) Successful in 15s
ci / shellcheck (pull_request) Successful in 8s
ci / conventions (pull_request) Successful in 2s
ci / image (pull_request) Successful in 2s
e9a1d59f61
MHE merged commit 69d6f3f07b into main 2026-11-10 13:27:30 +01:00
MHE deleted branch run-sh-prompt-install-missing-deps 2026-11-10 13:37:08 +01:00
Sign in to join this conversation.
No reviewers
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
openso/docker-templates!36
No description provided.