-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsetup.sh
More file actions
executable file
·69 lines (59 loc) · 1.98 KB
/
setup.sh
File metadata and controls
executable file
·69 lines (59 loc) · 1.98 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
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
#!/bin/bash
# Setup script for Household Resilience Monitor
echo "==================================="
echo "Household Resilience Monitor Setup"
echo "==================================="
# Check if Python 3 is installed
if ! command -v python3 &> /dev/null; then
echo "Error: Python 3 is required but not installed."
echo "Please install Python 3.8 or higher."
exit 1
fi
echo "✓ Python 3 found: $(python3 --version)"
# Create virtual environment if it doesn't exist
if [ ! -d "venv" ]; then
echo "Creating virtual environment..."
python3 -m venv venv
echo "✓ Virtual environment created"
else
echo "✓ Virtual environment already exists"
fi
# Activate virtual environment
echo "Activating virtual environment..."
source venv/bin/activate
# Install dependencies
echo "Installing dependencies..."
pip install --upgrade pip
pip install -r requirements.txt
echo "✓ Dependencies installed"
# Create necessary directories
echo "Creating required directories..."
mkdir -p logs
mkdir -p data/{raw,processed,historical,exports}
mkdir -p alerts
mkdir -p config
echo "✓ Directories created"
# Copy secrets template if needed
if [ ! -f "config/secrets.yaml" ] && [ -f "config/secrets.yaml.template" ]; then
echo "Creating secrets.yaml from template..."
cp config/secrets.yaml.template config/secrets.yaml
echo "✓ Secrets file created - please edit config/secrets.yaml with your credentials"
fi
# Run import test
echo ""
echo "Testing imports..."
python test_imports.py
echo ""
echo "==================================="
echo "Setup complete!"
echo "==================================="
echo ""
echo "To run the monitor:"
echo " 1. Activate virtual environment: source venv/bin/activate"
echo " 2. Run status check: python src/main.py --check-status"
echo " 3. Run continuous monitoring: python src/main.py"
echo ""
echo "Configuration:"
echo " - Edit config/config.yaml for thresholds and settings"
echo " - Edit config/secrets.yaml for API keys and credentials"
echo ""