-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtest_container_env.sh
More file actions
49 lines (39 loc) · 1.16 KB
/
test_container_env.sh
File metadata and controls
49 lines (39 loc) · 1.16 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
#!/bin/bash
# Test script to debug container environment and Git availability
# Create a temporary directory
TEMP_DIR=$(mktemp -d)
echo "Created temporary directory: $TEMP_DIR"
# Create a test script to run inside the container
cat > "$TEMP_DIR/test_git.sh" << 'EOF'
#!/bin/bash
# Print environment information
echo "=== Environment Variables ==="
printenv | sort
echo ""
# Check PATH
echo "=== PATH ==="
echo "$PATH"
echo ""
# Check if git exists
if command -v git &> /dev/null; then
echo "Git found at: $(which git)"
echo "Git version: $(git --version)"
else
echo "Git not found in PATH"
echo "Searching for git in common locations..."
find / -name git -type f -executable 2>/dev/null | grep -v "Permission denied" || echo "No git found"
fi
# Check Python environment
echo ""
echo "=== Python Environment ==="
which python3
python3 --version
python3 -c "import sys; print('Python path:', sys.path)"
EOF
chmod +x "$TEMP_DIR/test_git.sh"
# Run the test in the container
echo "Running test in container..."
podman run --rm -v "$TEMP_DIR:/test" localhost/digy-base:latest /test/test_git.sh
# Clean up
rm -rf "$TEMP_DIR"
echo "Cleaned up temporary directory"