Add verbose curl debugging and connectivity tests to diagnose exitcode 1 failures
Some checks failed
Build libostree Backport / Build libostree Backport (push) Failing after 9m58s

This commit is contained in:
robojerk 2025-07-21 19:30:50 +00:00
parent 0eeb2857ec
commit 5e5540c964
3 changed files with 136 additions and 130 deletions

View file

@ -102,47 +102,47 @@ jobs:
curl -s -H "Authorization: Bearer ${{ secrets.FORGEJO_TOKEN }}" \
"https://git.raines.xyz/api/v1/packages/robojerk/generic" | jq . 2>/dev/null || echo "Generic packages endpoint failed"
- name: Test package upload with steam.deb
run: |
echo "=== Testing package upload with steam.deb ==="
# Check if steam.deb exists
if [ ! -f "steam.deb" ]; then
echo "❌ steam.deb not found, skipping upload test"
echo "Available files:"
ls -la *.deb 2>/dev/null || echo "No .deb files found"
exit 0
fi
# Test Debian Package Registry upload
echo "Testing Debian Package Registry upload..."
response=$(curl -s -w "%{http_code}" --user "robojerk:${{ secrets.ACCESS_TOKEN }}" \
--upload-file "steam.deb" \
"https://git.raines.xyz/api/packages/robojerk/debian/pool/noble/main/upload")
http_code=$(echo "$response" | tail -c 4)
echo "Debian Package Registry HTTP Response Code: $http_code"
if [ "$http_code" = "201" ]; then
echo "✅ Debian Package Registry upload SUCCESS"
else
echo "❌ Debian Package Registry upload FAILED (HTTP $http_code)"
fi
echo ""
echo "Testing Generic Package Registry upload..."
response=$(curl -s -w "%{http_code}" --user "robojerk:${{ secrets.ACCESS_TOKEN }}" \
--upload-file "steam.deb" \
"https://git.raines.xyz/api/packages/robojerk/generic/steam/1.0.0.83/steam.deb")
http_code=$(echo "$response" | tail -c 4)
echo "Generic Package Registry HTTP Response Code: $http_code"
if [ "$http_code" = "201" ]; then
echo "✅ Generic Package Registry upload SUCCESS"
else
echo "❌ Generic Package Registry upload FAILED (HTTP $http_code)"
fi
# - name: Test package upload with steam.deb
# run: |
# echo "=== Testing package upload with steam.deb ==="
#
# # Check if steam.deb exists
# if [ ! -f "steam.deb" ]; then
# echo "❌ steam.deb not found, skipping upload test"
# echo "Available files:"
# ls -la *.deb 2>/dev/null || echo "No .deb files found"
# exit 0
# fi
#
# # Test Debian Package Registry upload
# echo "Testing Debian Package Registry upload..."
# response=$(curl -s -w "%{http_code}" --user "robojerk:${{ secrets.ACCESS_TOKEN }}" \
# --upload-file "steam.deb" \
# "https://git.raines.xyz/api/packages/robojerk/debian/pool/noble/main/upload")
#
# http_code=$(echo "$response" | tail -c 4)
# echo "Debian Package Registry HTTP Response Code: $http_code"
#
# if [ "$http_code" = "201" ]; then
# echo "✅ Debian Package Registry upload SUCCESS"
# else
# echo "❌ Debian Package Registry upload FAILED (HTTP $http_code)"
# fi
#
# echo ""
# echo "Testing Generic Package Registry upload..."
# response=$(curl -s -w "%{http_code}" --user "robojerk:${{ secrets.ACCESS_TOKEN }}" \
# --upload-file "steam.deb" \
# "https://git.raines.xyz/api/packages/robojerk/generic/steam/1.0.0.83/steam.deb")
#
# http_code=$(echo "$response" | tail -c 4)
# echo "Generic Package Registry HTTP Response Code: $http_code"
#
# if [ "$http_code" = "201" ]; then
# echo "✅ Generic Package Registry upload SUCCESS"
# else
# echo "❌ Generic Package Registry upload FAILED (HTTP $http_code)"
# fi
- name: Add source repositories
run: |
@ -254,9 +254,40 @@ jobs:
run: |
echo "=== Attempting Debian Package Registry upload with ACCESS_TOKEN ==="
# Basic connectivity tests
echo "=== Testing basic connectivity ==="
echo "Testing DNS resolution..."
nslookup git.raines.xyz || echo "DNS resolution failed"
echo "Testing HTTPS connectivity..."
curl -I https://git.raines.xyz || echo "HTTPS connectivity failed"
echo "Testing API endpoint accessibility..."
curl -I https://git.raines.xyz/api/v1/version || echo "API endpoint test failed"
echo "=== End connectivity tests ==="
# Initialize array to store uploaded package IDs
uploaded_debian_ids=()
echo "=== Checking for .deb files ==="
echo "Current directory: $(pwd)"
echo "release-assets directory contents:"
ls -la release-assets/ 2>/dev/null || echo "release-assets directory not found"
echo "All .deb files in current directory:"
find . -name "*.deb" -type f 2>/dev/null || echo "No .deb files found"
echo "=== End file check ==="
# Check if ACCESS_TOKEN is available (without exposing the actual token)
echo "=== Checking ACCESS_TOKEN ==="
if [ -n "${{ secrets.ACCESS_TOKEN }}" ]; then
echo "ACCESS_TOKEN is set (length: ${#ACCESS_TOKEN} characters)"
else
echo "❌ ACCESS_TOKEN is not set or empty"
exit 1
fi
echo "=== End token check ==="
for deb_file in release-assets/*.deb; do
if [ -f "$deb_file" ]; then
echo "Uploading $deb_file to Debian Package Registry..."
@ -264,9 +295,14 @@ jobs:
echo "File: $filename"
# Capture full response (headers + body) to parse HTTP code AND package ID
response_and_code=$(curl -s -i --user "robojerk:${{ secrets.ACCESS_TOKEN }}" \
# Add -v for verbose output and redirect stderr to see connection details
response_and_code=$(curl -v -i --user "robojerk:${{ secrets.ACCESS_TOKEN }}" \
--upload-file "$deb_file" \
"https://git.raines.xyz/api/packages/robojerk/debian/pool/noble/main/upload")
"https://git.raines.xyz/api/packages/robojerk/debian/pool/noble/main/upload" 2>&1)
echo "=== Full curl output for $deb_file ==="
echo "$response_and_code"
echo "=== End curl output ==="
# Extract HTTP code (from headers)
http_code=$(echo "$response_and_code" | head -n 1 | grep -oP 'HTTP/\d.\d \K\d{3}')