|
| 1 | +#!/bin/bash |
| 2 | +set -e |
| 3 | + |
| 4 | +echo "🚀 Setting up Seclab Taskflow Agent development environment..." |
| 5 | + |
| 6 | +# Create Python virtual environment |
| 7 | +echo "📦 Creating Python virtual environment..." |
| 8 | +python3 -m venv .venv |
| 9 | + |
| 10 | +# Activate virtual environment and install dependencies |
| 11 | +echo "📥 Installing Python dependencies..." |
| 12 | +source .venv/bin/activate |
| 13 | +python -m pip install --upgrade pip |
| 14 | +python -m pip install -r requirements.txt |
| 15 | + |
| 16 | +# If running in Codespaces, check for necessary secrets and print error if missing |
| 17 | +if [ -n "$CODESPACES" ]; then |
| 18 | + echo "🔐 Running in Codespaces - injecting secrets from Codespaces settings..." |
| 19 | + if [ -n "$COPILOT_TOKEN" ]; then |
| 20 | + echo "Running in Codespaces - please add COPILOT_TOKEN to your Codespaces secrets" |
| 21 | + fi |
| 22 | + if [ -n "$GITHUB_AUTH_HEADER" ]; then |
| 23 | + echo "Running in Codespaces - please add GITHUB_AUTH_HEADER to your Codespaces secrets" |
| 24 | + fi |
| 25 | +fi |
| 26 | + |
| 27 | +# Create .env file if it doesn't exist |
| 28 | +if [ ! -f .env ]; then |
| 29 | + echo "📝 Creating .env template..." |
| 30 | + cat > .env << 'EOF' |
| 31 | +
|
| 32 | +# Optional: CodeQL database base path |
| 33 | +CODEQL_DBS_BASE_PATH=/workspaces/seclab-taskflow-agent/my_data |
| 34 | +
|
| 35 | +EOF |
| 36 | + echo "⚠️ Please configure the enviroment or your .env file with required tokens!" |
| 37 | +fi |
| 38 | + |
| 39 | +# Create logs directory if it doesn't exist |
| 40 | +mkdir -p logs |
| 41 | + |
| 42 | +# Create optional data directories |
| 43 | +mkdir -p my_data |
| 44 | + |
| 45 | +echo "✅ Development environment setup complete!" |
| 46 | +echo "" |
| 47 | +echo "📋 Next steps:" |
| 48 | +echo "Configure your environment with COPILOT_TOKEN and GITHUB_AUTH_HEADER as needed." |
| 49 | +echo "💡 Remember to activate the virtual environment: source .venv/bin/activate" |
0 commit comments