common-install-routines.sh¶
Shared library of functions and utilities for module installation scripts.
Usage¶
Source this file in install scripts:
Features¶
- Color definitions for terminal output (YW, BL, RD, GN, etc.)
info()- Print informational messages in greenwarn()- Print warning messages in yellowerror()- Print error messages in redget_config_value()- Extract values from module JSON configurationcheck_json()- Validate a module JSON file against module-fields.json schema- Validates that script runs on tappaas-cicd host
- Loads JSON configuration from
/home/tappaas/config/<vmname>.json
Example¶
. common-install-routines.sh mymodule
vmid=$(get_config_value "vmid")
cores=$(get_config_value "cores" "2") # with default value
check_json /home/tappaas/config/mymodule.json || exit 1
Available Functions¶
get_config_value¶
Extract a value from the loaded module JSON configuration.
check_json¶
Validate a JSON file against the module-fields.json schema.
info, warn, error¶
Print colored messages to terminal.
See Also¶
- copy-update-json.sh - Copy and modify module JSON
- install-vm.sh - VM creation library