2022-12-31 14:19:03 +01:00
|
|
|
# Homelab setup scripts
|
|
|
|
|
|
|
|
Everything is homebaked, because it's at my house!
|
|
|
|
|
|
|
|
## Dependencies
|
|
|
|
|
|
|
|
- python 3, bash, and coreutils
|
|
|
|
|
|
|
|
## Creating & running scripts
|
|
|
|
|
|
|
|
Every script has a directory inside `scripts/`. They must be ran through the `run.sh` script.
|
|
|
|
|
|
|
|
Usually scripts are checkpointed. Each checkpoint is a function beginning with `_ch_`. It is then
|
|
|
|
collected and run by calling `_run_checkpoints`. They will be run in alphabetical order and if
|
|
|
|
one fails, the script will stop execution. You can then make changes, or fix the issue externally,
|
|
|
|
and then run the script again. It will skip all successfully completed checkpoints.
|
|
|
|
|
|
|
|
`_lib.sh` should always be imported at the start of the script. It contains all the helper functions.
|
|
|
|
|
|
|
|
See `scripts/template` for an example.
|
|
|
|
|
|
|
|
## Unattended?
|
2022-12-31 22:46:38 +01:00
|
|
|
|
2022-12-31 14:19:03 +01:00
|
|
|
Not really, but most steps should be automatic
|
2022-12-31 22:46:38 +01:00
|
|
|
|
|
|
|
## Fully rerun a script
|
|
|
|
|
|
|
|
Remove run.checkpoints from the script root directory. This will reset the script's idempotency check.
|
|
|
|
It is just a text file with names of checkpoints that have successfully completed. You can edit it to
|
|
|
|
skip certain parts, or replay them.
|