...
This commit is contained in:
19
install.sh
19
install.sh
@@ -1,6 +1,6 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
|
|
||||||
# Herolib Web Server Installation Script
|
# KnowledgeCenter Web Server Installation Script
|
||||||
# This script sets up the necessary environment for the Flask web server.
|
# This script sets up the necessary environment for the Flask web server.
|
||||||
|
|
||||||
set -e # Exit on any error
|
set -e # Exit on any error
|
||||||
@@ -16,7 +16,7 @@ NC='\033[0m' # No Color
|
|||||||
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
|
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
|
||||||
cd "$SCRIPT_DIR"
|
cd "$SCRIPT_DIR"
|
||||||
|
|
||||||
echo -e "${BLUE}🔧 Setting up Herolib Web Server Environment${NC}"
|
echo -e "${BLUE}🔧 Setting up KnowledgeCenter Web Server Environment${NC}"
|
||||||
echo "=================================================="
|
echo "=================================================="
|
||||||
|
|
||||||
# Check if uv is installed
|
# Check if uv is installed
|
||||||
@@ -39,5 +39,20 @@ fi
|
|||||||
# Sync dependencies
|
# Sync dependencies
|
||||||
echo -e "${YELLOW}📦 Installing dependencies with uv...${NC}"
|
echo -e "${YELLOW}📦 Installing dependencies with uv...${NC}"
|
||||||
uv sync
|
uv sync
|
||||||
|
if [ -d "$HOME/code/git.ourworld.tf/herocode/herolib_python/herolib" ]; then
|
||||||
|
echo -e "${GREEN}✅ Found local herolib, installing...${NC}"
|
||||||
|
uv pip install -e "$HOME/code/git.ourworld.tf/herocode/herolib_python"
|
||||||
|
else
|
||||||
|
echo -e "${YELLOW}📦 Local herolib not found, installing from git...${NC}"
|
||||||
|
uv pip install herolib@git+https://git.ourworld.tf/herocode/herolib_python.git --force-reinstall --no-cache-dir
|
||||||
|
fi
|
||||||
echo -e "${GREEN}✅ Dependencies installed${NC}"
|
echo -e "${GREEN}✅ Dependencies installed${NC}"
|
||||||
|
|
||||||
|
# Create necessary directories
|
||||||
|
mkdir -p static/css static/js static/images
|
||||||
|
mkdir -p templates
|
||||||
|
mkdir -p md
|
||||||
|
|
||||||
|
echo -e "${GREEN}✅ Directory structure verified${NC}"
|
||||||
|
|
||||||
|
echo -e "${GREEN}🎉 Installation complete! You can now run start_server.sh${NC}"
|
@@ -1,20 +1,12 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
|
export PYTHONPATH=$PYTHONPATH:$(pwd)/src
|
||||||
|
|
||||||
|
|
||||||
# Get the directory where this script is located
|
# Get the directory where this script is located
|
||||||
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
|
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
|
||||||
cd "$SCRIPT_DIR"
|
cd "$SCRIPT_DIR"
|
||||||
|
|
||||||
echo "Setting up Herolib environment in: $SCRIPT_DIR"
|
echo "Setting up KnowledgeCenter environment in: $SCRIPT_DIR"
|
||||||
|
|
||||||
# Check if uv is installed
|
|
||||||
if ! command -v uv &> /dev/null; then
|
|
||||||
echo "❌ uv is not installed. Please install uv first:"
|
|
||||||
echo " curl -LsSf https://astral.sh/uv/install.sh | sh"
|
|
||||||
echo " or visit: https://docs.astral.sh/uv/getting-started/installation/"
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
|
|
||||||
echo "✅ uv found: $(uv --version)"
|
|
||||||
|
|
||||||
# Create virtual environment if it doesn't exist
|
# Create virtual environment if it doesn't exist
|
||||||
if [ ! -d ".venv" ]; then
|
if [ ! -d ".venv" ]; then
|
||||||
@@ -25,9 +17,6 @@ else
|
|||||||
echo "✅ Virtual environment already exists"
|
echo "✅ Virtual environment already exists"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
export PATH="$SCRIPT_DIR/.venv/bin:$PATH"
|
|
||||||
|
|
||||||
# Activate virtual environment
|
# Activate virtual environment
|
||||||
echo "🔄 Activating virtual environment..."
|
echo "🔄 Activating virtual environment..."
|
||||||
source .venv/bin/activate
|
source .venv/bin/activate
|
||||||
|
|
@@ -9,10 +9,13 @@ readme = "README.md"
|
|||||||
requires-python = ">=3.8"
|
requires-python = ">=3.8"
|
||||||
dependencies = ["peewee"]
|
dependencies = ["peewee"]
|
||||||
|
|
||||||
|
|
||||||
[build-system]
|
[build-system]
|
||||||
requires = ["setuptools>=61.0"]
|
requires = ["setuptools>=61.0","wheel"]
|
||||||
build-backend = "setuptools.build_meta"
|
build-backend = "setuptools.build_meta"
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
[tool.setuptools.packages.find]
|
[tool.setuptools.packages.find]
|
||||||
where = ["."]
|
where = ["."]
|
||||||
include = ["herolib*"]
|
include = ["herolib*"]
|
Reference in New Issue
Block a user