-
Notifications
You must be signed in to change notification settings - Fork 11
Expand file tree
/
Copy pathdocker-solve.sh
More file actions
executable file
·60 lines (50 loc) · 1.79 KB
/
docker-solve.sh
File metadata and controls
executable file
·60 lines (50 loc) · 1.79 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
#!/bin/bash
# Docker wrapper for solve.mjs
# Usage: ./docker-solve.sh [solve.mjs arguments]
set -e
echo "🐳 Running solve.mjs in Docker container..."
echo ""
# Check if Docker is available
if ! command -v docker &> /dev/null; then
echo "❌ Docker is not installed or not in PATH"
echo "Please install Docker first: https://docs.docker.com/get-docker/"
exit 1
fi
# Check if Docker daemon is running
if ! docker info >/dev/null 2>&1; then
echo "❌ Docker daemon is not running"
echo "Please start Docker first"
exit 1
fi
# Create output directory if it doesn't exist
mkdir -p ./output
# Build the Docker image if it doesn't exist or if --build is passed
if [[ "$1" == "--build" ]] || [[ "$(docker images -q hive-mind-solver 2> /dev/null)" == "" ]]; then
echo "🔨 Building Docker image..."
docker build -t hive-mind-solver .
if [[ "$1" == "--build" ]]; then
shift # Remove --build from arguments
fi
fi
# Pass all arguments to solve.mjs inside the container
echo "🚀 Starting solve.mjs with arguments: $*"
echo ""
# Run the container with proper volume mounts and argument passing
docker run --rm -it \
-v ~/.config/gh:/workspace/.persisted-configs/gh:ro \
-v ~/.local/share/claude-profiles:/workspace/.persisted-configs/claude:ro \
-v ~/.config/claude-code:/workspace/.persisted-configs/claude-code:ro \
-v "$(pwd)/output:/workspace/output" \
-e GITHUB_TOKEN="${GITHUB_TOKEN:-}" \
-e CLAUDE_API_KEY="${CLAUDE_API_KEY:-}" \
hive-mind-solver \
bash -c "
# Restore credentials first
./docker-restore-auth.sh
echo ''
# Then run the solve script with passed arguments
./solve.mjs $*
"
echo ""
echo "🎉 Docker execution completed!"
echo "📁 Check ./output/ directory for any generated files"