infctl-cli/docs/API_REFERENCE.md
jon brookes 2ab7872af1 Add Google Cloud K3s infrastructure support
- Add Terraform configuration for GCP instance and storage
- Add startup script for K3s installation and configuration
- Add pipeline scripts for deployment and management
- Add Forgejo deployment manifests and configuration
2025-10-02 15:41:50 +01:00

1.2 KiB

API Reference

This document describes the API and pipeline functions available in infctl-cli.

PipelineStep Structure

Each pipeline step is defined as:

  • name: Step name (string)
  • function: Function to call (string)
  • params: List of parameters (array of strings)
  • retryCount: Number of retries (integer)
  • shouldAbort: Whether to abort on failure (boolean)

Available Functions

k8sNamespaceExists

Checks if a Kubernetes namespace exists.

  • Params: [namespace] (string)
  • Returns: error if namespace does not exist

RunCommand

Runs a shell command.

  • Params: [command] (string)
  • Returns: error if command fails

Example Pipeline JSON

[
  {
    "name": "ensure inf namespace exists",
    "function": "k8sNamespaceExists",
    "params": ["infctl"],
    "retryCount": 0,
    "shouldAbort": true
  },
  {
    "name": "create php configmap",
    "function": "RunCommand",
    "params": ["./scripts/create_php_configmap_ctl.sh"],
    "retryCount": 0,
    "shouldAbort": true
  }
]

Notes

  • Only functions defined in the codebase are available for use in pipelines.
  • The API does not expose any HTTP endpoints; all orchestration is via CLI and pipeline JSON.