-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathinstall.sh
More file actions
executable file
·100 lines (84 loc) · 2.9 KB
/
install.sh
File metadata and controls
executable file
·100 lines (84 loc) · 2.9 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
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
#!/bin/bash
# GitStats - Install and setup (run once)
# Usage: ./install.sh
set -e
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
cd "${SCRIPT_DIR}"
CONFIG_FILE="${CONFIG_FILE:-${SCRIPT_DIR}/config.yaml}"
echo "=========================================="
echo "GitStats - Installation & Setup"
echo "=========================================="
echo ""
# Check prerequisites
echo "Checking prerequisites..."
if ! command -v docker &> /dev/null; then
echo "❌ Error: Docker is not installed"
echo "Install: https://www.docker.com/products/docker-desktop"
exit 1
fi
if ! command -v python3 &> /dev/null; then
echo "❌ Error: Python 3 is not installed"
exit 1
fi
if ! command -v uv &> /dev/null; then
echo "Installing uv..."
curl -LsSf https://astral.sh/uv/install.sh | sh
export PATH="$HOME/.cargo/bin:$PATH"
fi
echo "✓ All prerequisites met"
echo ""
# Install Python dependencies
echo "Installing Python dependencies..."
if uv pip install -r requirements.txt --system 2>/dev/null; then
echo "✓ Dependencies installed (system)"
elif uv pip install -r requirements.txt 2>/dev/null; then
echo "✓ Dependencies installed (user)"
else
echo "⚠ UV install failed, trying pip..."
python3 -m pip install -r requirements.txt --user --break-system-packages
echo "✓ Dependencies installed (pip user)"
fi
echo ""
# Start Docker services
echo "Starting Docker services..."
docker compose up -d
echo "✓ Docker services started"
echo ""
# Read Elasticsearch configuration
if [ -f "${CONFIG_FILE}" ] && command -v python3 &> /dev/null; then
ES_HOST="${ES_HOST:-$(python3 "${SCRIPT_DIR}/scripts/read-config.py" "${CONFIG_FILE}" "elasticsearch.host" 2>/dev/null || echo "localhost")}"
ES_PORT="${ES_PORT:-$(python3 "${SCRIPT_DIR}/scripts/read-config.py" "${CONFIG_FILE}" "elasticsearch.port" 2>/dev/null || echo "9200")}"
else
ES_HOST="${ES_HOST:-localhost}"
ES_PORT="${ES_PORT:-9200}"
fi
ES_URL="http://${ES_HOST}:${ES_PORT}"
# Wait for Elasticsearch
echo "Waiting for Elasticsearch to be ready at ${ES_URL}..."
until curl -s "${ES_URL}/_cluster/health" > /dev/null 2>&1; do
echo " Still waiting..."
sleep 5
done
echo "✓ Elasticsearch is ready"
echo ""
# Setup Elasticsearch indices
echo "Setting up Elasticsearch indices..."
./scripts/setup-elasticsearch-indices.sh
echo ""
echo "=========================================="
echo "✓ Installation Complete!"
echo "=========================================="
echo ""
echo "Services running:"
echo " • Grafana: http://localhost:3000 (admin/admin)"
echo " • Elasticsearch: ${ES_URL}"
echo " • Dejavu: http://localhost:1358"
echo ""
echo "Next steps:"
echo " 1. Clone repositories into ./repositories/"
echo " 2. Configure email mapping in config.yaml"
echo " 3. Run: ./run.sh"
echo ""
echo "Note: You only need to run ./install.sh once."
echo " Use ./run.sh for regular updates."
echo ""