CI/CD integration

Run Gaet safely in a non-interactive pipeline.

Global flags for automation

FlagEffect
-q, --quietSuppress non-essential output
--plainPipe-safe output without ANSI colors
--jsonMachine-readable output on supported commands
-y, --yesAuto-confirm destructive prompts

Exit codes

CodeMeaning
0Success
1General failure
2Usage error or unknown command
80Configuration error
81Local database unavailable
82Remote database unavailable
83Operation locked by a running backup
84Required PostgreSQL tools missing

Validate before mutation

gaet check --json

Stop the job when the check fails. The CLI help documents a shell pattern for this:

gaet check --json | jq '.ok'

Run a backup

gaet push --json

Provide credentials through the CI secret manager as environment variables. Process environment variables take priority over the Gaet environment file.

GAET_LOCAL_URL=postgresql://user:pass@127.0.0.1:5432/app
GAET_REMOTE_URL=postgresql://user:pass@db.example.com:5432/app

GitHub Actions

- name: Verify Gaet
  run: gaet check --json

- name: Push backup
  run: gaet push --json
  env:
    GAET_LOCAL_URL: ${{ secrets.GAET_LOCAL_URL }}
    GAET_REMOTE_URL: ${{ secrets.GAET_REMOTE_URL }}

Destructive workflows

gaet fetch --yes
gaet restore latest --yes

Fetch and restore overwrite the local database. Run them only in a job whose target has been selected intentionally, and gate the step behind an environment approval.

Pipeline checks

gaet status --json
gaet snapshots --json
gaet doctor --json

Notifications

gaet push accepts --notify=URL to post the result to a webhook, which lets a pipeline surface backup failures without parsing output.