|
| 1 | +#!/bin/bash |
| 2 | +# Verify Ubuntu configuration has proper sudo commands |
| 3 | + |
| 4 | +echo "╔════════════════════════════════════════════════════════════════╗" |
| 5 | +echo "║ ║" |
| 6 | +echo "║ Ubuntu Configuration Verification ║" |
| 7 | +echo "║ ║" |
| 8 | +echo "╚════════════════════════════════════════════════════════════════╝" |
| 9 | +echo |
| 10 | + |
| 11 | +GREEN='\033[0;32m' |
| 12 | +RED='\033[0;31m' |
| 13 | +NC='\033[0m' |
| 14 | + |
| 15 | +WORKFLOW=".github/workflows/build-matrix.yml" |
| 16 | +ERRORS=0 |
| 17 | + |
| 18 | +echo "Checking Ubuntu dependencies section..." |
| 19 | +echo |
| 20 | + |
| 21 | +# Check for sudo commands |
| 22 | +if grep -A 30 "Install dependencies (Ubuntu)" "$WORKFLOW" | grep -q "sudo apt-get"; then |
| 23 | + echo -e "${GREEN}✓${NC} sudo apt-get commands found" |
| 24 | +else |
| 25 | + echo -e "${RED}✗${NC} Missing sudo for apt-get" |
| 26 | + ((ERRORS++)) |
| 27 | +fi |
| 28 | + |
| 29 | +if grep -A 30 "Install dependencies (Ubuntu)" "$WORKFLOW" | grep -q "sudo mkdir"; then |
| 30 | + echo -e "${GREEN}✓${NC} sudo mkdir found" |
| 31 | +else |
| 32 | + echo -e "${RED}✗${NC} Missing sudo for mkdir" |
| 33 | + ((ERRORS++)) |
| 34 | +fi |
| 35 | + |
| 36 | +if grep -A 30 "Install dependencies (Ubuntu)" "$WORKFLOW" | grep -q "sudo tee"; then |
| 37 | + echo -e "${GREEN}✓${NC} sudo tee found (for file writes)" |
| 38 | +else |
| 39 | + echo -e "${RED}✗${NC} Missing sudo tee for file writes" |
| 40 | + ((ERRORS++)) |
| 41 | +fi |
| 42 | + |
| 43 | +# Check PostgreSQL repository setup |
| 44 | +if grep -A 30 "Install dependencies (Ubuntu)" "$WORKFLOW" | grep -q "postgresql.gpg"; then |
| 45 | + echo -e "${GREEN}✓${NC} PostgreSQL GPG key configured" |
| 46 | +else |
| 47 | + echo -e "${RED}✗${NC} Missing PostgreSQL GPG key" |
| 48 | + ((ERRORS++)) |
| 49 | +fi |
| 50 | + |
| 51 | +if grep -A 30 "Install dependencies (Ubuntu)" "$WORKFLOW" | grep -q "pgdg.list"; then |
| 52 | + echo -e "${GREEN}✓${NC} PostgreSQL repository configured" |
| 53 | +else |
| 54 | + echo -e "${RED}✗${NC} Missing PostgreSQL repository" |
| 55 | + ((ERRORS++)) |
| 56 | +fi |
| 57 | + |
| 58 | +# Check for required packages |
| 59 | +PACKAGES=(build-essential postgresql-server-dev golang-go libjson-c-dev pkg-config) |
| 60 | +echo |
| 61 | +echo "Checking required packages..." |
| 62 | +for pkg in "${PACKAGES[@]}"; do |
| 63 | + if grep -A 30 "Install dependencies (Ubuntu)" "$WORKFLOW" | grep -q "$pkg"; then |
| 64 | + echo -e "${GREEN}✓${NC} Package: $pkg" |
| 65 | + else |
| 66 | + echo -e "${RED}✗${NC} Missing package: $pkg" |
| 67 | + ((ERRORS++)) |
| 68 | + fi |
| 69 | +done |
| 70 | + |
| 71 | +echo |
| 72 | +echo "━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━" |
| 73 | + |
| 74 | +if [ $ERRORS -eq 0 ]; then |
| 75 | + echo -e "${GREEN}✓ Ubuntu configuration looks good!${NC}" |
| 76 | + echo |
| 77 | + echo "Configuration summary:" |
| 78 | + echo " ✓ sudo used for all system commands" |
| 79 | + echo " ✓ PostgreSQL repository configured" |
| 80 | + echo " ✓ All required packages included" |
| 81 | + echo " ✓ man-db optimization (best effort)" |
| 82 | + exit 0 |
| 83 | +else |
| 84 | + echo -e "${RED}✗ Found $ERRORS issue(s)${NC}" |
| 85 | + exit 1 |
| 86 | +fi |
0 commit comments