API Reference
Installation
Section titled “Installation”Install infctl
command line tool:
curl -L https://codeberg.org/headshed/infctl-cli/raw/branch/main/install.sh | bash
Or download from Releases and place in your PATH
.
infctl
uses JSON files for configuration and is designed around pipelines that perform a series of steps.
Functions
Section titled “Functions”k8sNamespaceExists
Section titled “k8sNamespaceExists”Ensures a Kubernetes namespace exists.
Parameters:
namespace
(string) - Name of the namespace
Example:
{ "name": "ensure inf namespace exists", "function": "k8sNamespaceExists", "params": ["infctl"], "retryCount": 0, "shouldAbort": true}
RunCommand
Section titled “RunCommand”Executes a shell command, script, or executable.
Parameters:
command
(string) - Command, script path, or executable to run
Examples:
{ "name": "run setup script", "function": "RunCommand", "params": ["./scripts/create_php_configmap_ctl.sh"], "retryCount": 0, "shouldAbort": true}
{ "name": "say hello", "function": "RunCommand", "params": ["echo 'hello world'"], "retryCount": 0, "shouldAbort": true}
Task Properties
Section titled “Task Properties”Required
Section titled “Required”name
- Human-readable description displayed in logsfunction
- Name of function registered within infctlparams
- Array of string parameters passed to the function
Optional
Section titled “Optional”retryCount
- Number of times to retry if task fails (default: 0)shouldAbort
- Whether to stop pipeline if task fails (default: true)
Execution Behavior
Section titled “Execution Behavior”- Tasks execute in sequence
- Task fails if script/command returns non-zero exit code
- Failed tasks retry up to
retryCount
times - If
shouldAbort
istrue
and task fails, pipeline stops - If
shouldAbort
isfalse
, pipeline continues to next task - Unlimited flexibility through
RunCommand
for any automation