38 lines
1.1 KiB
Bash
38 lines
1.1 KiB
Bash
#!/usr/bin/env bash
|
||
set -euo pipefail
|
||
|
||
TARGET_DIR="${1:-.}"
|
||
OUTPUT_DIR="${2:-tests/reports/agents}"
|
||
mkdir -p "$OUTPUT_DIR"
|
||
SUMMARY_FILE="$OUTPUT_DIR/ssh_scripts_agent.md"
|
||
|
||
echo "# Agent SSH & scripts" > "$SUMMARY_FILE"
|
||
echo >> "$SUMMARY_FILE"
|
||
|
||
pushd "$TARGET_DIR" >/dev/null
|
||
paths=(
|
||
scripts/auto-ssh-push.sh
|
||
scripts/init-ssh-env.sh
|
||
scripts/setup-ssh-ci.sh
|
||
scripts/scripts/auto-ssh-push.sh
|
||
scripts/scripts/init-ssh-env.sh
|
||
scripts/scripts/setup-ssh-ci.sh
|
||
)
|
||
|
||
found=0
|
||
for p in "${paths[@]}"; do
|
||
if [[ -f "$p" ]]; then echo "- Trouvé: $p" >> "$SUMMARY_FILE"; found=1; fi
|
||
done
|
||
if [[ $found -eq 0 ]]; then echo "- Scripts SSH standard introuvables (vérifier l’arborescence)." >> "$SUMMARY_FILE"; fi
|
||
|
||
if [[ -f docs/SSH_UPDATE.md ]]; then echo "- docs/SSH_UPDATE.md présent." >> "$SUMMARY_FILE"; fi
|
||
|
||
PROMPT=$(cat <<'P'
|
||
Propose une checklist de conformité SSH (permissions, secrets CI, idempotence, journalisation non sensible) et intégration de contrôles CI.
|
||
P
|
||
)
|
||
"scripts/agents/ai_prompt.sh" "$PROMPT" >> "$SUMMARY_FILE" || true
|
||
|
||
echo "Rapport: $SUMMARY_FILE"
|
||
popd >/dev/null
|