Clone
1
CLI_AUTOMATION
Jonathan Miller edited this page 2026-05-19 20:49:12 +00:00

← Back to Home

CLI and Automation Scripts

Scripts for managing client repos, triggering workflows, and validating deployments.


CLI Scripts

scaffold_client.php

Scaffold a new client-waas repo from Template-Client-WaaS with pre-configured settings.

php cli/scaffold_client.php --name clarksvillefurs --org ClarksvilleFurs --token YOUR_TOKEN
php cli/scaffold_client.php --name newclient --org NewClient --token YOUR_TOKEN --dry-run

Steps performed:

  1. Creates repo from Template-Client-WaaS via Gitea API
  2. Sets repo description
  3. Creates dev branch from main
  4. Prints instructions for configuring repo variables and secrets

client_inventory.php

Discover and list all client-waas repos with their server configuration status.

php cli/client_inventory.php --token YOUR_TOKEN
php cli/client_inventory.php --token YOUR_TOKEN --json

Output table: Org | Repo | Has Dev Config | Has Live Config | Last Push | Status

bulk_workflow_trigger.php

Trigger a workflow across multiple repos at once.

# All repos in an org
php cli/bulk_workflow_trigger.php --org ClarksvilleFurs --workflow sync-servers.yml --token YOUR_TOKEN

# Specific repos from file
php cli/bulk_workflow_trigger.php --repos repos.txt --workflow sync-servers.yml --token YOUR_TOKEN

# With inputs
php cli/bulk_workflow_trigger.php --org ClarksvilleFurs --workflow sync-servers.yml         --inputs '{"direction":"dev-to-live","dry_run":"true"}' --token YOUR_TOKEN

Automation Scripts

bulk_workflow_trigger.sh

Shell wrapper for triggering workflows across all client-waas repos in an org.

./automation/bulk_workflow_trigger.sh GITEA_URL TOKEN ORG WORKFLOW [REF] [INPUTS_JSON]

Validation Scripts

check_file_integrity.php

Compare deployed files on a remote server against the local repository to detect drift.

php validate/check_file_integrity.php --config sftp-config.json
php validate/check_file_integrity.php --config sftp-config.json --repo-path /path/to/repo --verbose
php validate/check_file_integrity.php --config sftp-config.json --json

Output: Total files | Match | Differ | Server-only | Repo-only

Exits 1 if any drift detected, 0 if clean.



Repo: moko-platform

Revision Date Author Description
1.0 2026-05-19 Moko Consulting Initial version