Files
AdventureLog/scripts/install/lib/main.sh
Sean Morley 7f6bf1390a Add Docker and environment configuration files for AdventureLog
- Introduced .dockerignore to exclude unnecessary files from Docker context.
- Added .env.aio.example for minimal configuration of the AdventureLog All-in-One setup.
- Updated .env.example to include optional SITE_URL and GUNICORN_WORKERS settings.
- Enhanced deploy.sh script for improved deployment flexibility and backup options.
- Updated docker-compose files to use PostGIS 16-3.5 and added health checks for services.
- Created docker-compose.aio.yml for All-in-One deployment configuration.
- Improved health checks and service dependencies in docker-compose.dev.yml and docker-compose.yml.
- Added GitHub workflows for building and pushing Docker images, including smoke tests for AIO setup.
2026-06-06 18:54:25 -04:00

81 lines
1.8 KiB
Bash
Executable File

#!/bin/bash
# Main install orchestration.
set -euo pipefail
choose_setup_type() {
if [[ "${DRY_RUN:-false}" == true ]]; then
SETUP_TYPE="aio"
resolve_compose_settings
return 0
fi
print_step_header 2 7 "Choose setup type"
local choice
if ! choice="$(tui_choose "Select installation type" \
"All-in-One (recommended — single URL, minimal config)" \
"Standard (advanced — separate frontend and backend)")"; then
choice="All-in-One (recommended — single URL, minimal config)"
fi
case "$choice" in
Standard*)
SETUP_TYPE="standard"
;;
*)
SETUP_TYPE="aio"
;;
esac
resolve_compose_settings
log_info "Selected: $SETUP_TYPE"
}
run_fresh_install() {
print_screen "Starting installation — $(date)"
init_tui
run_preflight
if [[ -z "${SETUP_TYPE:-}" ]] || [[ "$SETUP_TYPE" == "aio" && -z "${SITE_URL:-}" ]]; then
choose_setup_type
fi
ensure_install_directory
if [[ "$SETUP_TYPE" == "aio" ]]; then
download_aio_toolkit
run_aio_install_wizard
write_env_aio
else
download_standard_toolkit
run_standard_install_wizard
write_env_standard
fi
trap 'cleanup_on_failure; print_failure_message; exit 1' ERR
run_deploy_phase
save_credentials_file
if [[ "$SETUP_TYPE" == "aio" ]]; then
print_aio_success
else
print_standard_success
fi
}
run_installer_main() {
if [[ "$FORCE_INSTALL" != true ]]; then
if [[ -d "$INSTALL_DIR" ]] && detect_existing_install "$INSTALL_DIR"; then
init_tui
if [[ "${ADVENTURELOG_MANAGE:-}" == "1" ]] || tui_confirm "Existing AdventureLog install detected. Open management menu?" "y"; then
INSTALL_DIR="$(cd "$INSTALL_DIR" && pwd)"
run_management_menu
return 0
fi
fi
if [[ "${ADVENTURELOG_MANAGE:-}" == "1" ]]; then
init_tui
run_management_menu
return 0
fi
fi
run_fresh_install
}