133 lines
3.5 KiB
Bash
Executable File
133 lines
3.5 KiB
Bash
Executable File
#!/bin/bash
|
|
# Development Ecosystem Installer
|
|
#
|
|
# Installs all projects in the development ecosystem in the correct order.
|
|
# Projects are cloned from Gitea and installed as editable packages.
|
|
#
|
|
# Usage:
|
|
# ./install-ecosystem # Fresh install to ~/PycharmProjects
|
|
# ./install-ecosystem --update # Update existing repos and reinstall
|
|
# ./install-ecosystem --help # Show this help
|
|
#
|
|
# Projects installed (in order):
|
|
# 1. CmdForge - AI-powered CLI tools
|
|
# 2. ramble - Voice note transcription
|
|
# 3. artifact-editor - Visual artifact editor
|
|
# 4. orchestrated-discussions - Multi-agent AI discussions
|
|
# 5. development-hub - Central orchestration GUI
|
|
|
|
set -e
|
|
|
|
GITEA_URL="https://gitea.brrd.tech/rob"
|
|
PROJECTS_DIR="${PROJECTS_DIR:-$HOME/PycharmProjects}"
|
|
VENV_DIR="${VENV_DIR:-$PROJECTS_DIR/development-hub/.venv}"
|
|
|
|
# Project definitions: name, repo_name, extras
|
|
PROJECTS=(
|
|
"CmdForge:CmdForge:"
|
|
"ramble:ramble:"
|
|
"artifact-editor:artifact-editor:"
|
|
"orchestrated-discussions:orchestrated-discussions:gui"
|
|
"development-hub:development-hub:"
|
|
)
|
|
|
|
show_help() {
|
|
head -20 "$0" | tail -n +2 | sed 's/^# //' | sed 's/^#//'
|
|
}
|
|
|
|
info() {
|
|
echo -e "\033[1;34m==>\033[0m \033[1m$1\033[0m"
|
|
}
|
|
|
|
success() {
|
|
echo -e "\033[1;32m==>\033[0m \033[1m$1\033[0m"
|
|
}
|
|
|
|
error() {
|
|
echo -e "\033[1;31m==>\033[0m \033[1m$1\033[0m" >&2
|
|
}
|
|
|
|
# Parse arguments
|
|
UPDATE_MODE=false
|
|
while [[ $# -gt 0 ]]; do
|
|
case $1 in
|
|
--update|-u)
|
|
UPDATE_MODE=true
|
|
shift
|
|
;;
|
|
--help|-h)
|
|
show_help
|
|
exit 0
|
|
;;
|
|
*)
|
|
error "Unknown option: $1"
|
|
exit 1
|
|
;;
|
|
esac
|
|
done
|
|
|
|
# Ensure projects directory exists
|
|
mkdir -p "$PROJECTS_DIR"
|
|
cd "$PROJECTS_DIR"
|
|
|
|
info "Installing development ecosystem to $PROJECTS_DIR"
|
|
|
|
# Clone or update repositories
|
|
for project_spec in "${PROJECTS[@]}"; do
|
|
IFS=':' read -r name repo extras <<< "$project_spec"
|
|
project_dir="$PROJECTS_DIR/$name"
|
|
|
|
if [[ -d "$project_dir" ]]; then
|
|
if [[ "$UPDATE_MODE" == "true" ]]; then
|
|
info "Updating $name..."
|
|
cd "$project_dir"
|
|
git fetch origin
|
|
git pull --ff-only origin main 2>/dev/null || git pull --ff-only origin master 2>/dev/null || true
|
|
cd "$PROJECTS_DIR"
|
|
else
|
|
info "$name already exists, skipping clone"
|
|
fi
|
|
else
|
|
info "Cloning $name..."
|
|
git clone "$GITEA_URL/$repo.git" "$name"
|
|
fi
|
|
done
|
|
|
|
# Create or activate virtual environment
|
|
if [[ ! -d "$VENV_DIR" ]]; then
|
|
info "Creating virtual environment at $VENV_DIR..."
|
|
python3 -m venv "$VENV_DIR"
|
|
fi
|
|
|
|
info "Activating virtual environment..."
|
|
source "$VENV_DIR/bin/activate"
|
|
|
|
# Upgrade pip
|
|
pip install --upgrade pip wheel setuptools -q
|
|
|
|
# Install projects in order
|
|
for project_spec in "${PROJECTS[@]}"; do
|
|
IFS=':' read -r name repo extras <<< "$project_spec"
|
|
project_dir="$PROJECTS_DIR/$name"
|
|
|
|
if [[ -n "$extras" ]]; then
|
|
info "Installing $name[$extras]..."
|
|
pip install -e "$project_dir[$extras]" -q
|
|
else
|
|
info "Installing $name..."
|
|
pip install -e "$project_dir" -q
|
|
fi
|
|
done
|
|
|
|
success "Installation complete!"
|
|
echo ""
|
|
echo "To use the ecosystem:"
|
|
echo " source $VENV_DIR/bin/activate"
|
|
echo " development-hub # Launch the GUI"
|
|
echo ""
|
|
echo "Individual tools:"
|
|
echo " cmdforge # AI-powered CLI tools"
|
|
echo " ramble # Voice note transcription"
|
|
echo " artifact-editor # Visual artifact editor"
|
|
echo " discussions # Multi-agent AI discussions"
|