Some checks failed
Build + Deploy / build-admin-compliance (push) Failing after 45s
Build + Deploy / build-backend-compliance (push) Successful in 13s
Build + Deploy / build-ai-sdk (push) Successful in 40s
Build + Deploy / build-developer-portal (push) Successful in 12s
Build + Deploy / build-tts (push) Successful in 11s
Build + Deploy / build-document-crawler (push) Successful in 14s
Build + Deploy / build-dsms-gateway (push) Successful in 12s
Build + Deploy / trigger-orca (push) Has been skipped
CI/CD / loc-budget (push) Successful in 21s
CI/CD / guardrail-integrity (push) Has been skipped
CI/CD / go-lint (push) Has been skipped
CI/CD / python-lint (push) Has been skipped
CI/CD / nodejs-lint (push) Has been skipped
CI/CD / test-go-ai-compliance (push) Successful in 48s
CI/CD / test-python-backend-compliance (push) Failing after 38s
CI/CD / test-python-document-crawler (push) Successful in 31s
CI/CD / test-python-dsms-gateway (push) Successful in 27s
CI/CD / sbom-scan (push) Has been skipped
CI/CD / validate-canonical-controls (push) Successful in 19s
There is only one remote (origin). Removed all occurrences of:
- git push gitea / git push origin main && git push gitea main
- "Pushing to gitea (external)" in deploy.sh
- # gitea: git@gitea.meghsakha.com:... remote comment in docs-src/index.md
- "Push auf gitea triggert" → "Push auf origin triggert" in docs
- Clone URL updated to ssh://git@coolify.meghsakha.com:22222/... in
README.md and CONTRIBUTING.md
Web UI URLs (gitea.meghsakha.com/...) are unchanged — those are still valid.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
52 lines
1.8 KiB
Bash
52 lines
1.8 KiB
Bash
#!/bin/bash
|
|
# Apply Consent History migration and rebuild backend-compliance on Mac Mini
|
|
# Usage: bash scripts/apply_consent_history_migration.sh
|
|
|
|
set -e
|
|
|
|
DOCKER="/usr/local/bin/docker"
|
|
BACKEND_CONTAINER="bp-compliance-backend"
|
|
PROJECT_DIR="/Users/benjaminadmin/Projekte/breakpilot-compliance"
|
|
|
|
echo "==> Pushing code to Mac Mini..."
|
|
git push origin main
|
|
|
|
echo "==> Pulling code on Mac Mini..."
|
|
ssh macmini "git -C ${PROJECT_DIR} pull --no-rebase origin main"
|
|
|
|
echo "==> Applying Consent History migration (009_consent_history.sql)..."
|
|
ssh macmini "${DOCKER} exec ${BACKEND_CONTAINER} \
|
|
psql \"\${DATABASE_URL}\" -f /app/migrations/009_consent_history.sql \
|
|
&& echo 'Consent History migration applied' \
|
|
|| echo 'psql failed, trying python...'"
|
|
|
|
ssh macmini "${DOCKER} exec ${BACKEND_CONTAINER} \
|
|
python3 -c \"
|
|
import psycopg2, os
|
|
conn = psycopg2.connect(os.environ['DATABASE_URL'])
|
|
conn.autocommit = True
|
|
cur = conn.cursor()
|
|
with open('/app/migrations/009_consent_history.sql', 'r') as f:
|
|
sql = f.read()
|
|
cur.execute(sql)
|
|
cur.close()
|
|
conn.close()
|
|
print('Consent History migration (python) applied')
|
|
\"" 2>/dev/null || echo "Note: Migration already applied or use manual SQL."
|
|
|
|
echo ""
|
|
echo "==> Rebuilding backend-compliance..."
|
|
ssh macmini "${DOCKER} compose -f ${PROJECT_DIR}/docker-compose.yml build --no-cache backend-compliance && \
|
|
${DOCKER} compose -f ${PROJECT_DIR}/docker-compose.yml up -d backend-compliance"
|
|
|
|
echo ""
|
|
echo "==> Verifying history endpoint..."
|
|
sleep 5
|
|
curl -sk "https://macmini:8002/api/compliance/einwilligungen/consents/test/history" \
|
|
-H "X-Tenant-ID: test-tenant" \
|
|
| python3 -c "import sys,json; d=json.load(sys.stdin); print(f'History endpoint OK: {type(d).__name__}')" \
|
|
|| echo "Endpoint check needs backend restart"
|
|
|
|
echo ""
|
|
echo "Done. Check logs: ssh macmini '${DOCKER} logs -f ${BACKEND_CONTAINER}'"
|