chore(scripts): Update CI, dev, release, and testing scripts

This commit is contained in:
Jeremie Fraeys 2026-02-23 14:13:55 -05:00
parent 2fdc9b9218
commit fa97521488
No known key found for this signature in database
7 changed files with 26 additions and 26 deletions

View file

@ -17,7 +17,7 @@ for binary in api-server worker tui data_manager; do
fi
done
if [ $FAILED -eq 0 ]; then
echo "No binaries in root"
echo "No binaries in root"
fi
# Check 2: No .DS_Store files
@ -28,7 +28,7 @@ if [ "$DSSTORE_COUNT" -gt 0 ]; then
find . -name ".DS_Store" -type f | head -5
FAILED=1
else
echo "No .DS_Store files"
echo "No .DS_Store files"
fi
# Check 3: No coverage.out in root
@ -37,14 +37,14 @@ if [ -f "./coverage.out" ]; then
echo "✗ FAIL: coverage.out found in root (should be in coverage/)"
FAILED=1
else
echo "No coverage.out in root"
echo "No coverage.out in root"
fi
# Check 4: Bin directory should exist or be empty
echo "Checking bin/ directory..."
if [ -d "./bin" ]; then
BIN_COUNT=$(ls -1 ./bin 2>/dev/null | wc -l)
echo "bin/ exists ($BIN_COUNT files)"
echo "bin/ exists ($BIN_COUNT files)"
else
echo " bin/ does not exist (will be created by make build)"
fi
@ -53,7 +53,7 @@ fi
echo "Checking data/ directory..."
if [ -d "./data" ]; then
if git check-ignore -q ./data 2>/dev/null; then
echo "data/ is gitignored"
echo "data/ is gitignored"
else
echo "⚠ WARNING: data/ exists but may not be gitignored"
fi
@ -64,7 +64,7 @@ fi
# Summary
echo ""
if [ $FAILED -eq 0 ]; then
echo "All path conventions verified"
echo "All path conventions verified"
exit 0
else
echo "✗ Path convention verification failed"

View file

@ -44,7 +44,7 @@ func checkNativeLibs() {
found := false
for _, path := range libPaths {
if _, err := os.Stat(path); err == nil {
fmt.Printf("Found: %s\n", path)
fmt.Printf("Found: %s\n", path)
found = true
}
}

View file

@ -49,7 +49,7 @@ if [[ "$native_mode" == true ]]; then
cmake .. -DCMAKE_BUILD_TYPE=Release -DENABLE_ASAN=OFF >/dev/null 2>&1 || true
make -j4 2>&1 | grep -E "(Built|Error|error)" || true
cd ../..
echo " Native libraries built"
echo " Native libraries built"
else
echo " ⚠ native/build not found, skipping native build"
fi
@ -65,7 +65,7 @@ if [[ "$native_mode" == true ]]; then
# Build Go with native libs
echo "3. Building Go applications with native libs..."
FETCHML_NATIVE_LIBS=1 go build -o /dev/null ./cmd/api-server 2>&1 | grep -v "ignoring duplicate" || true
echo " api-server builds"
echo " api-server builds"
FETCHML_NATIVE_LIBS=1 go build -o /dev/null ./cmd/worker 2>&1 | grep -v "ignoring duplicate" || true 2>/dev/null || echo " (worker optional)"
echo ""
fi

View file

@ -21,4 +21,4 @@ if grep -rE "(sk-[a-zA-Z0-9]{20,}|password: [^\"'*]+[^*])" configs/examples/ 2>/
echo "WARNING: Potential real credentials found in example configs!"
fi
echo "Config sanitization complete"
echo "Config sanitization complete"

View file

@ -63,7 +63,7 @@ if [ -f ./api-server ]; then
fi
if [ $FAILED -eq 0 ]; then
echo "All release checks passed"
echo "All release checks passed"
exit 0
else
echo "✗ Release checks failed"

View file

@ -47,12 +47,12 @@ echo " - Redis: localhost:6379"
echo " - Metrics: http://localhost:9100"
echo ""
echo "Features enabled:"
echo " Auth with homelab_user/password"
echo " SQLite database at /app/data/fetch_ml.db"
echo " Podman containerized job execution"
echo " SSH communication between containers"
echo " TLS encryption"
echo " Rate limiting and security"
echo " Auth with homelab_user/password"
echo " SQLite database at /app/data/fetch_ml.db"
echo " Podman containerized job execution"
echo " SSH communication between containers"
echo " TLS encryption"
echo " Rate limiting and security"
echo ""
echo "To test with CLI:"
echo " ./cli/zig-out/bin/ml queue prod-test-job"

View file

@ -29,7 +29,7 @@ echo "=== Checking Docker Compose Services ==="
cd "$REPO_ROOT/deployments"
if docker-compose -f docker-compose.prod.smoke.yml ps | grep -q "ml-smoke-caddy"; then
echo "Caddy container running"
echo "Caddy container running"
else
echo "✗ Caddy container not running"
echo "Start services: docker-compose -f docker-compose.prod.smoke.yml up -d"
@ -37,7 +37,7 @@ else
fi
if docker-compose -f docker-compose.prod.smoke.yml ps | grep -q "ml-ssh-test"; then
echo "SSH test container running"
echo "SSH test container running"
else
echo "✗ SSH test container not running"
echo "Start services: docker-compose -f docker-compose.prod.smoke.yml up -d"
@ -49,7 +49,7 @@ echo "=== Test 1: SSH Connectivity ==="
echo "Testing SSH connection..."
if ssh -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null \
-p "$SSH_PORT" -i "$SSH_KEY" "$SSH_USER@$SSH_HOST" 'echo "SSH OK"' | grep -q "SSH OK"; then
echo "SSH connection successful"
echo "SSH connection successful"
else
echo "✗ SSH connection failed"
exit 1
@ -62,7 +62,7 @@ TERM_VALUE=$(ssh -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null \
-p "$SSH_PORT" -i "$SSH_KEY" "$SSH_USER@$SSH_HOST" 'echo $TERM')
echo "TERM=$TERM_VALUE"
if [[ -n "$TERM_VALUE" ]]; then
echo "TERM variable set"
echo "TERM variable set"
else
echo "✗ TERM variable not set"
fi
@ -74,7 +74,7 @@ HEALTH_OUTPUT=$(ssh -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null
-p "$SSH_PORT" -i "$SSH_KEY" "$SSH_USER@$SSH_HOST" \
'curl -s http://caddy:80/health' 2>/dev/null || echo "FAIL")
if echo "$HEALTH_OUTPUT" | grep -q "healthy"; then
echo "API reachable through Caddy"
echo "API reachable through Caddy"
echo "Response: $HEALTH_OUTPUT"
else
echo "✗ API not reachable"
@ -92,7 +92,7 @@ WS_OUTPUT=$(ssh -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null \
'curl -i -N -H "Connection: Upgrade" -H "Upgrade: websocket" \
http://caddy:80/ws/status 2>&1 | head -5' || echo "FAIL")
if echo "$WS_OUTPUT" | grep -q "101\|Upgrade"; then
echo "WebSocket proxy working"
echo "WebSocket proxy working"
echo "Response headers:"
echo "$WS_OUTPUT"
else
@ -104,14 +104,14 @@ echo ""
echo "=== Test 5: TUI Config Check ==="
ssh -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null \
-p "$SSH_PORT" -i "$SSH_KEY" "$SSH_USER@$SSH_HOST" \
'cat /config/.ml/config.toml' && echo "TUI config mounted" || echo "✗ Config missing"
'cat /config/.ml/config.toml' && echo "TUI config mounted" || echo "✗ Config missing"
echo ""
echo "=== Test 6: TUI Binary Check ==="
if ssh -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null \
-p "$SSH_PORT" -i "$SSH_KEY" "$SSH_USER@$SSH_HOST" \
'ls -la /usr/local/bin/tui 2>/dev/null'; then
echo "TUI binary present"
echo "TUI binary present"
# Check binary architecture
BINARY_CHECK=$(ssh -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null \
@ -119,7 +119,7 @@ if ssh -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null \
'head -c 20 /usr/local/bin/tui | od -c | head -1' 2>/dev/null || echo "FAIL")
if echo "$BINARY_CHECK" | grep -q "ELF"; then
echo "Binary is Linux ELF format"
echo "Binary is Linux ELF format"
else
echo "⚠ Binary may not be Linux format (expected ELF)"
echo " Check output: $BINARY_CHECK"