Operational scripts
This document describes the operational scripts in the
scripts
directory. These scripts support developing, validating, provisioning, and
maintaining the home lab.
Run every script from the repository root: the scripts source
scripts/common.sh and resolve configuration files using paths relative to the
repository root. Most scripts wrap containerized tools, so they require a
working Docker installation.
Linting and formatting
scripts/lint.sh runs
super-linter against the whole
repository, using the same container image version and configuration as the
Lint CI workflow (.github/workflows/lint.yaml and
config/lint/super-linter.env), so a clean local run closely predicts a clean
CI run:
scripts/lint.sh
The script supports the following environment variables:
-
LINTER_CONTAINER_FIX_MODE: set totrueto run the linters in fix mode (loadsconfig/lint/super-linter-fix-mode.env), letting formatters apply fixes to the working tree instead of only reporting issues:LINTER_CONTAINER_FIX_MODE=true scripts/lint.sh -
LINTER_CONTAINER_OPEN_SHELL: set totrueto open an interactive Bash shell inside the linter container instead of running the linters, useful to debug linter configuration. LINTER_CONTAINER_IMAGE_VERSION: override the linter container image version. Defaults to the version that theLintCI workflow pins.LOG_LEVEL: super-linter log level. Defaults toINFO.
scripts/run-pre-commit.sh runs the configured
pre-commit hooks
(config/pre-commit/.pre-commit-config.yaml) against all files, creating a
dedicated Python virtual environment on first run. Pass an argument to run a
different command inside that environment instead.
Provisioning and configuration
scripts/bootstrap-host.sh <hostname> <expected_mac>: bootstraps a home lab host, validating that the target machine's MAC address matches the expected one before deploying. Hosts with adisko.nixare installed withnixos-anywhere; hosts without one (LXC containers) receive their configuration vianixos-rebuild switch --flake --target-host.scripts/run-ansible.sh: runs Ansible playbooks fromconfig/ansibleinside a purpose-built container.scripts/run-terraform.sh: iterates over the numbered Terraform service directories inconfig/terraformand runsterraform initandterraform applyfor each one. Runscripts/run-terraform.sh output <service> [<output-name>]to print a service's outputs as JSON instead.
Documentation site
scripts/run-mkdocs.sh builds or serves the documentation sites with Material
for MkDocs. See Develop and build the Home Lab site.
CI/CD tooling
scripts/open-shell-ci-cd-tools-container.sh: opens an interactive shell in the CI/CD tools container (docker/ci-cd-tools).scripts/release-please-dry-run.sh: runs a release-pleaserelease-prdry run against the current branch to preview release notes and version bumps.scripts/run-renovate.sh: runs Renovate locally.
Miscellaneous
scripts/build-arduino-project.sh: compiles an Arduino project for a given fully qualified board name (FQBN).scripts/copy-data.sh <source-host> <source-directory> <target-directory>: copies data from a remote host with rsync. SetENABLE_DRY_RUN=truefor a dry run andENABLE_CHECKSUM=trueto compare files by checksum.scripts/common.sh: shared helper functions and variables sourced by the other scripts; not meant to be invoked directly.