Fix workflow issues: add network tools, fix directory logic, improve diagnostics
This commit is contained in:
parent
9efa4bb12a
commit
989beeb14b
2 changed files with 40 additions and 57 deletions
|
|
@ -35,54 +35,46 @@ jobs:
|
|||
- name: Checkout code and setup environment
|
||||
run: |
|
||||
apt update -y
|
||||
apt install -y git curl pkg-config libssl-dev libsystemd-dev build-essential file zip nodejs npm iproute2
|
||||
apt install -y git curl pkg-config libssl-dev libsystemd-dev build-essential file zip nodejs npm iproute2 dnsutils iputils-ping
|
||||
|
||||
# Install required Rust components
|
||||
echo "Installing Rust components..."
|
||||
rustup component add clippy
|
||||
rustup component add rustfmt
|
||||
rustup component add rust-src # For better error messages
|
||||
rustup component add rust-analysis # For IDE support
|
||||
rustup component add clippy rustfmt rust-src rust-analysis
|
||||
|
||||
# Enhanced network diagnostics
|
||||
echo "=== NETWORK DIAGNOSTICS ==="
|
||||
echo "Container hostname: $(hostname)"
|
||||
echo "Container IP: $(hostname -i)"
|
||||
echo "Container DNS: $(cat /etc/resolv.conf)"
|
||||
echo "Container IP: $(ip route get 8.8.8.8 | awk '{print $7; exit}')"
|
||||
echo "Container DNS:"
|
||||
cat /etc/resolv.conf
|
||||
echo "Container routing:"
|
||||
ip route show
|
||||
ip route
|
||||
|
||||
# Test hostname resolution
|
||||
echo "=== HOSTNAME RESOLUTION TESTS ==="
|
||||
echo "Testing forgejo hostname:"
|
||||
nslookup forgejo || echo "❌ forgejo hostname not resolved"
|
||||
|
||||
nslookup forgejo 8.8.8.8 || echo "❌ forgejo hostname not resolved"
|
||||
echo "Testing git.raines.xyz hostname:"
|
||||
nslookup git.raines.xyz || echo "❌ git.raines.xyz hostname not resolved"
|
||||
|
||||
nslookup git.raines.xyz 8.8.8.8 || echo "❌ git.raines.xyz hostname not resolved"
|
||||
echo "Testing explicit FORGEJO_HOST ($FORGEJO_HOST):"
|
||||
nslookup $FORGEJO_HOST || echo "❌ FORGEJO_HOST not resolved"
|
||||
|
||||
nslookup $FORGEJO_HOST 8.8.8.8 || echo "❌ FORGEJO_HOST not resolved"
|
||||
echo "Testing external DNS (google.com):"
|
||||
nslookup google.com || echo "❌ External DNS not working"
|
||||
nslookup google.com 8.8.8.8 || echo "❌ External DNS not working"
|
||||
|
||||
# Test IP connectivity
|
||||
echo "=== IP CONNECTIVITY TESTS ==="
|
||||
echo "Testing Google DNS (8.8.8.8):"
|
||||
ping -c 3 8.8.8.8 || echo "❌ Google DNS ping failed"
|
||||
|
||||
echo "Testing Cloudflare DNS (1.1.1.1):"
|
||||
ping -c 3 1.1.1.1 || echo "❌ Cloudflare DNS ping failed"
|
||||
|
||||
# Try to resolve Forgejo server IP if not provided
|
||||
if [ -z "$FORGEJO_IP" ]; then
|
||||
# Try to resolve the Forgejo server IP
|
||||
echo "=== RESOLVING FORGEJO SERVER IP ==="
|
||||
FORGEJO_IP=$(nslookup $FORGEJO_HOST | grep -A1 "Name:" | grep "Address:" | awk '{print $2}' | head -1)
|
||||
if [ -n "$FORGEJO_IP" ]; then
|
||||
FORGEJO_IP=$(nslookup $FORGEJO_HOST 8.8.8.8 2>/dev/null | grep -A1 "Name:" | tail -1 | awk '{print $2}')
|
||||
if [ -n "$FORGEJO_IP" ] && [ "$FORGEJO_IP" != "NXDOMAIN" ]; then
|
||||
echo "✅ Resolved $FORGEJO_HOST to IP: $FORGEJO_IP"
|
||||
echo "FORGEJO_IP=$FORGEJO_IP" >> $GITHUB_ENV
|
||||
else
|
||||
echo "❌ Could not resolve $FORGEJO_HOST to IP"
|
||||
fi
|
||||
fi
|
||||
|
||||
# Test direct IP connectivity if available
|
||||
if [ -n "$FORGEJO_IP" ]; then
|
||||
|
|
@ -123,7 +115,6 @@ jobs:
|
|||
exit 1
|
||||
}
|
||||
echo "✅ Cargo operations test passed"
|
||||
cd /tmp/deb-bootupd
|
||||
|
||||
# Clone repository
|
||||
git clone https://git.raines.xyz/robojerk/deb-bootupd.git /tmp/deb-bootupd
|
||||
|
|
|
|||
|
|
@ -31,54 +31,46 @@ jobs:
|
|||
- name: Checkout code and setup environment
|
||||
run: |
|
||||
apt update -y
|
||||
apt install -y git curl pkg-config libssl-dev libsystemd-dev build-essential file zip nodejs npm iproute2
|
||||
apt install -y git curl pkg-config libssl-dev libsystemd-dev build-essential file zip nodejs npm iproute2 dnsutils iputils-ping
|
||||
|
||||
# Install required Rust components
|
||||
echo "Installing Rust components..."
|
||||
rustup component add clippy
|
||||
rustup component add rustfmt
|
||||
rustup component add rust-src # For better error messages
|
||||
rustup component add rust-analysis # For IDE support
|
||||
rustup component add clippy rustfmt rust-src rust-analysis
|
||||
|
||||
# Enhanced network diagnostics
|
||||
echo "=== NETWORK DIAGNOSTICS ==="
|
||||
echo "Container hostname: $(hostname)"
|
||||
echo "Container IP: $(hostname -i)"
|
||||
echo "Container DNS: $(cat /etc/resolv.conf)"
|
||||
echo "Container IP: $(ip route get 8.8.8.8 | awk '{print $7; exit}')"
|
||||
echo "Container DNS:"
|
||||
cat /etc/resolv.conf
|
||||
echo "Container routing:"
|
||||
ip route show
|
||||
ip route
|
||||
|
||||
# Test hostname resolution
|
||||
echo "=== HOSTNAME RESOLUTION TESTS ==="
|
||||
echo "Testing forgejo hostname:"
|
||||
nslookup forgejo || echo "❌ forgejo hostname not resolved"
|
||||
|
||||
nslookup forgejo 8.8.8.8 || echo "❌ forgejo hostname not resolved"
|
||||
echo "Testing git.raines.xyz hostname:"
|
||||
nslookup git.raines.xyz || echo "❌ git.raines.xyz hostname not resolved"
|
||||
|
||||
nslookup git.raines.xyz 8.8.8.8 || echo "❌ git.raines.xyz hostname not resolved"
|
||||
echo "Testing explicit FORGEJO_HOST ($FORGEJO_HOST):"
|
||||
nslookup $FORGEJO_HOST || echo "❌ FORGEJO_HOST not resolved"
|
||||
|
||||
nslookup $FORGEJO_HOST 8.8.8.8 || echo "❌ FORGEJO_HOST not resolved"
|
||||
echo "Testing external DNS (google.com):"
|
||||
nslookup google.com || echo "❌ External DNS not working"
|
||||
nslookup google.com 8.8.8.8 || echo "❌ External DNS not working"
|
||||
|
||||
# Test IP connectivity
|
||||
echo "=== IP CONNECTIVITY TESTS ==="
|
||||
echo "Testing Google DNS (8.8.8.8):"
|
||||
ping -c 3 8.8.8.8 || echo "❌ Google DNS ping failed"
|
||||
|
||||
echo "Testing Cloudflare DNS (1.1.1.1):"
|
||||
ping -c 3 1.1.1.1 || echo "❌ Cloudflare DNS ping failed"
|
||||
|
||||
# Try to resolve Forgejo server IP if not provided
|
||||
if [ -z "$FORGEJO_IP" ]; then
|
||||
# Try to resolve the Forgejo server IP
|
||||
echo "=== RESOLVING FORGEJO SERVER IP ==="
|
||||
FORGEJO_IP=$(nslookup $FORGEJO_HOST | grep -A1 "Name:" | grep "Address:" | awk '{print $2}' | head -1)
|
||||
if [ -n "$FORGEJO_IP" ]; then
|
||||
FORGEJO_IP=$(nslookup $FORGEJO_HOST 8.8.8.8 2>/dev/null | grep -A1 "Name:" | tail -1 | awk '{print $2}')
|
||||
if [ -n "$FORGEJO_IP" ] && [ "$FORGEJO_IP" != "NXDOMAIN" ]; then
|
||||
echo "✅ Resolved $FORGEJO_HOST to IP: $FORGEJO_IP"
|
||||
echo "FORGEJO_IP=$FORGEJO_IP" >> $GITHUB_ENV
|
||||
else
|
||||
echo "❌ Could not resolve $FORGEJO_HOST to IP"
|
||||
fi
|
||||
fi
|
||||
|
||||
# Test direct IP connectivity if available
|
||||
if [ -n "$FORGEJO_IP" ]; then
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue