Commit 9e6d91f0 authored by Xu Wang's avatar Xu Wang Committed by otica-integrator-test
Browse files

docs: document NONINTERACTIVE escape hatch in confirm.sh

Closes #2
Changelog: added
parent d41c5395
Loading
Loading
Loading
Loading
+8 −0
Original line number Diff line number Diff line
@@ -1068,6 +1068,14 @@ my-destroy-target: ## Destroy resources
    # ... destructive commands
```

To bypass the prompt in CI or other non-interactive runs, set `NONINTERACTIVE`
to any non-empty value — `confirm.sh` then auto-confirms (exits 0) without
reading from the terminal:

```bash
make my-destroy-target NONINTERACTIVE=1
```

### 4. Keep TF_BUILD_DIR Out of Git

`tf-render` checks that `TF_BUILD_DIR` is gitignored before running. Add it to `.gitignore`:
+1 −1
Original line number Diff line number Diff line
@@ -698,7 +698,7 @@ All vault scripts read `VAULT_ADDR` from the environment. Path (`SEC_PATH`) and

| Script | Description |
|--------|-------------|
| `confirm.sh` | Print prompt, wait for `y/Y`; exit 1 otherwise |
| `confirm.sh` | Print prompt, wait for uppercase `Y`; exit 1 otherwise. Set `NONINTERACTIVE` (non-empty) to skip the prompt and auto-confirm (exit 0) for CI/automation |
| `tools-check.sh` | Check each tool in `tools.txt` is on `PATH`; report missing |
| `repos-update.sh` | Clone or `git pull` each repo listed in the argument file |
| `update-downstream-tag.sh` | Tag and push to trigger downstream pipelines |
+3 −0
Original line number Diff line number Diff line
#!/bin/sh
## Ask to confirm an action
##
## Escape hatch: set NONINTERACTIVE to any non-empty value to skip the prompt
## and auto-confirm (exit 0). Useful for CI/automation where no TTY is present.

if [ ! -z "${NONINTERACTIVE}" ]; then exit 0 ; fi