nomadcode/bin/nomadcode-sops-env
toki f23ba78eba feat: plane webhook intake & protosocket consumer wire readiness
- Add Plane webhook handler for issue events (created, state, assignees)
- Add Plane webhook integration tests with testdata fixtures
- Add Gito Protosocket consumer wire readiness milestone
- Add Plane work item webhook intake milestone
- Add agent-task for plane-work-item-webhook-intake (trigger dispatch, idempotency, live smoke)
- Update service config, router, handlers for Plane webhook endpoints
- Add SOPS env setup script and secrets configuration
- Update agent-ops domain rules and phase roadmap
2026-06-14 20:37:48 +09:00

47 lines
1.1 KiB
Bash
Executable file

#!/usr/bin/env bash
set -euo pipefail
if [[ $# -eq 0 ]]; then
echo "usage: bin/nomadcode-sops-env <command> [args...]" >&2
exit 64
fi
sops_bin="${SOPS_BIN:-sops}"
if ! command -v "$sops_bin" >/dev/null 2>&1; then
if [[ -x /opt/homebrew/bin/sops ]]; then
sops_bin="/opt/homebrew/bin/sops"
fi
fi
if ! command -v "$sops_bin" >/dev/null 2>&1; then
echo "sops is required to load NomadCode runtime secrets" >&2
exit 127
fi
repo_root="$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)"
secret_file="${NOMADCODE_SOPS_FILE:-$repo_root/secrets/nomadcode.dev.sops.yaml}"
if [[ ! -f "$secret_file" ]]; then
echo "NomadCode SOPS file not found: $secret_file" >&2
exit 66
fi
"$sops_bin" -d --output-type json "$secret_file" | python3 -c '
import json
import os
import sys
cmd = sys.argv[1:]
if not cmd:
raise SystemExit("missing command")
data = json.load(sys.stdin)
env = os.environ.copy()
for key, value in data.items():
if value is None:
continue
if isinstance(value, (str, int, float, bool)):
env[str(key)] = str(value)
os.execvpe(cmd[0], cmd, env)
' "$@"