Files
Maison/arti-api/auth-service/test-drone-jsonnet.sh
2026-02-10 12:12:11 +01:00

46 lines
1.6 KiB
Bash
Executable File

#!/bin/bash
# Test script to verify Drone Jsonnet configuration
echo "🔍 Testing Drone Jsonnet Configuration..."
echo "========================================="
echo "1. Checking .drone.jsonnet syntax..."
if jsonnet .drone.jsonnet > /dev/null 2>&1; then
echo "✅ .drone.jsonnet syntax is valid"
else
echo "❌ .drone.jsonnet syntax error"
jsonnet .drone.jsonnet
exit 1
fi
echo ""
echo "2. Checking Drone server status..."
kubectl get pods -n apps--droneio--prd -l app=droneio
echo ""
echo "3. Checking Drone configuration..."
echo "DRONE_JSONNET_ENABLED: $(kubectl get configmap drone -n apps--droneio--prd -o jsonpath='{.data.DRONE_JSONNET_ENABLED}')"
echo "DRONE_JSONNET_IMPORT_PATHS: $(kubectl get configmap drone -n apps--droneio--prd -o jsonpath='{.data.DRONE_JSONNET_IMPORT_PATHS}')"
echo ""
echo "4. Recent Drone server logs (looking for errors)..."
kubectl logs deployment/droneio -n apps--droneio--prd --tail=10 | grep -i "error\|warning\|jsonnet" || echo "No error/warning/jsonnet logs found"
echo ""
echo "5. Checking repository files..."
echo "Files in repository root:"
ls -la .drone*
echo ""
echo "Files in pipeline directory:"
ls -la pipeline/*.libsonnet 2>/dev/null || echo "No .libsonnet files found"
echo ""
echo "6. Testing jsonnet compilation with output..."
echo "Generated YAML pipeline:"
echo "------------------------"
jsonnet .drone.jsonnet | head -20
echo "... (output truncated)"
echo ""
echo "🏁 Test completed. If syntax is valid but builds aren't triggering,"
echo " the issue is likely with webhook configuration between Gitea and Drone."