Skip to content

feat: Fully Automated Setup & Cross-Platform CI/CD Pipeline#2

Merged
lpolish merged 25 commits intomainfrom
staging
Jun 10, 2025
Merged

feat: Fully Automated Setup & Cross-Platform CI/CD Pipeline#2
lpolish merged 25 commits intomainfrom
staging

Conversation

@lpolish
Copy link
Owner

@lpolish lpolish commented Jun 10, 2025

🚀 Major Enhancement: Complete Automation & Production-Ready CI/CD

This PR introduces a fully automated setup system and production-ready CI/CD pipeline for the Offline Doctor application, eliminating all manual intervention requirements.

✨ Key Features

🔧 Fully Automated Setup Scripts

  • Zero manual intervention across all platforms (Linux, macOS, Windows)
  • Support for 10+ Linux distributions with automatic OS detection
  • Container and bare-metal environment handling
  • Binary fallback installations when package managers unavailable
  • Automatic timezone configuration (UTC) to prevent tzdata prompts

�� Cross-Platform CI/CD Pipeline

  • Multi-platform testing (Ubuntu, Windows, macOS)
  • Automated release building for all platforms:
    • Linux: AppImage, DEB packages
    • Windows: NSIS installer
    • macOS: DMG packages
  • GitHub Pages documentation deployment
  • Comprehensive validation and testing workflows

🐳 Container & Docker Improvements

  • Non-interactive package installation
  • Proper timezone handling in all environments
  • Optimized Docker builds with multi-stage process

📋 Changes Overview

Setup Scripts:

  • setup.sh: Fully automated Linux/macOS setup with comprehensive OS support
  • setup.bat: Fully automated Windows setup with silent installations
  • run.sh: Enhanced runtime with dependency checking and virtual display support

CI/CD Workflows:

  • .github/workflows/ci.yml: New comprehensive testing workflow
  • .github/workflows/release.yml: Enhanced cross-platform release builds
  • .github/workflows/deploy-pages.yml: Improved documentation deployment

Docker & Containerization:

  • Dockerfile: Non-interactive timezone configuration
  • docker-compose.yml: Development environment improvements

Documentation:

  • Updated README with new automated setup instructions
  • Enhanced troubleshooting and platform-specific guidance

🎯 Impact

  • Users: One-command setup on any platform
  • Developers: Automated releases and testing
  • Maintainers: Zero manual deployment steps
  • Contributors: Comprehensive CI validation

🧪 Testing

All changes have been thoroughly tested:

  • ✅ Setup scripts validated on multiple platforms
  • ✅ Application startup verified (Python backend + Electron frontend)
  • ✅ CI workflows syntax validated
  • ✅ Docker builds tested with timezone fixes
  • ✅ Cross-platform packaging configuration verified

This makes Offline Doctor a production-ready medical application with enterprise-grade automation and deployment capabilities.

lpolish added 22 commits June 9, 2025 20:33
- Add better system detection and error handling in setup.sh
- Add package manager detection for different Linux distros
- Add proper Ollama model handling and verification
- Add desktop entry creation for Linux
- Simplify README installation instructions
- Add first-time usage tips
- Add check for if user is already root
- Better handling of sudo access
- Clearer error messages for privilege requirements
- Add smart detection of appropriate applications directory
- Use system-wide directory when running as root
- Create local directory if needed for regular users
- Add better path handling and feedback
- Add automatic dependency detection and installation
- Add support for multiple package managers
- Fix environment variables when running as root
- Preserve user context when running with sudo
- Add proper X11 and DBUS handling
- Add support for more package managers and distributions
- Add Wayland support
- Add multiple methods for dropping root privileges
- Add missing X11/Wayland dependencies
- Improve error handling and user feedback
- Fix display issues when running as root
- Add more Electron dependencies for different distros
- Add better display handling (X11/Wayland)
- Add proper error handling for privileges
- Add multiple methods for dropping root privileges
- Fix environment variables when running as root
- Add display access verification
- Use original user's home directory when running with sudo
- Use system-wide directory only when running as direct root
- Ensure directory exists before creating desktop entry
- Add automatic Node.js installation for all platforms
- Add automatic Python installation with version checking
- Improve error handling and verification steps
- Add support for multiple Linux package managers
- Add proper privilege handling for root/admin users
- Add build.sh for Linux/macOS builds
- Add build.bat for Windows builds
- Use Docker for consistent build environment
- Support cross-platform builds (Windows, Linux, macOS)
- Add automatic cleanup of Docker resources
- Ensure builds work without host dependencies
- Add release workflow for automatic package deployment
- Update GitHub Pages workflow
  - Add release trigger to update docs on new releases
  - Improve permission settings
  - Add workflow file trigger
  - Fetch full history for proper versioning
- Add development mode selection (Docker/Local/Both)
- Keep automatic dependency installation
- Support both containerized and local development
- Use sudo only when necessary
- Improve package manager detection and installation
- Keep Docker support while adding proper local dev support
- Add proper permissions for release creation
- Add full git history for release notes
- Fix Docker build setup
- Configure release file attachments
- Move mode selection to beginning of script
- Remove duplicate command_exists function
- Fix control flow to ensure variables are defined before use
- Remove duplicate code sections
- Fix control flow and if/fi matching
- Fix EOF and heredoc syntax
- Improve script organization
- Remove redundant echo statements
- Add container detection logic
- Skip Docker checks when running in containers
- Improve error handling for dependencies
- Better run script generation
- Handle both local and Docker modes correctly
- Replace manual installation prompts with automated dependency installation
- Add comprehensive OS detection (Debian, Fedora, Arch, openSUSE, Alpine, macOS)
- Support container environments and privilege escalation scenarios
- Add binary fallback installation for Node.js and Python when package managers fail
- Include GUI dependency installation for Electron applications
- Add colored output and proper error handling
- Create desktop entries automatically on Linux systems
- Support both container and bare-metal installations
- Validate all installations with proper error reporting

Resolves issues with manual intervention requirements during setup.
- Add multi-platform testing (Ubuntu, Windows, macOS)
- Validate setup script syntax across all platforms
- Test build process without full compilation for faster CI
- Validate package.json configuration and dependencies
- Check Jekyll documentation configuration
- Add Python backend import validation
- Ensure all components work together properly

This CI workflow catches issues early and validates setup scripts work correctly.
Release workflow improvements:
- Add proper cross-platform building (Linux, Windows, macOS)
- Include artifact uploading for all platforms
- Streamline release creation with automatic notes
- Remove duplicate build steps for efficiency

Pages deployment improvements:
- Add automatic Gemfile and _config.yml creation for Jekyll
- Optimize triggers to only run on docs changes
- Add production environment configuration
- Ensure robust documentation building and deployment

These workflows now provide fully automated releases and documentation updates.
- Add comprehensive dependency checking before startup
- Improve Ollama service management and verification
- Add virtual display support for headless environments
- Include proper error messages and user guidance
- Update package dependencies to latest versions

The run script now handles all edge cases and provides clear feedback to users.
- Update installation instructions to reflect fully automated setup
- Add clear platform-specific guidance (Linux, Windows, macOS)
- Include container environment support documentation
- Add troubleshooting section for common issues
- Emphasize no manual intervention required
- Update quick start guide with new automated flow

The README now accurately reflects the new fully automated setup process.
- Add backend/venv exclusion pattern to prevent packaging
- Prevents symlink security violations during electron-builder packaging
- Virtual environment will be created fresh during setup on target systems
- Resolves asar packaging errors for cross-platform builds
- Set DEBIAN_FRONTEND=noninteractive in Dockerfile and all build environments
- Configure UTC timezone by default in containers and CI/CD workflows
- Add timezone setup function to Linux/macOS setup script
- Set TZ=UTC environment variable in Windows setup script
- Update docker-compose.yml with proper timezone configuration
- Add timezone setup steps to GitHub Actions workflows
- Prevent interactive prompts during package installation

This resolves tzdata interactive configuration issues that block
automated builds and deployments in Docker and CI environments.
All environments now default to UTC timezone without user interaction.
@lpolish lpolish requested a review from Copilot June 10, 2025 06:08
@lpolish lpolish self-assigned this Jun 10, 2025
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR delivers end-to-end automation for Offline Doctor, adding a fully scripted setup on all platforms and extending the CI/CD pipeline to catch errors early and deploy artifacts across Linux, Windows, and macOS.

  • Enhanced test-setup.sh with structured output, colorized logging, and comprehensive dependency checks.
  • Introduced a fully automated setup.bat and new run.sh to start services and handle headless environments without manual steps.
  • Updated CI workflows, Docker configurations, and packaging scripts to support noninteractive builds and cross-platform releases.

Reviewed Changes

Copilot reviewed 14 out of 14 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
test-setup.sh Added colorized print functions and expanded setup validation
setup.bat Fully automated Windows installer with download helpers
run.sh New run script with dependency checks and virtual display support
package.json Excluded backend/venv from packaged resources
docker-compose.yml Enforced TZ=UTC and DEBIAN_FRONTEND=noninteractive
.github/workflows/ci.yml Extended CI to test setup scripts and builds
Comments suppressed due to low confidence (1)

.github/workflows/ci.yml:43

  • The CI config validates run.sh syntax on non-Windows runners but doesn't include a corresponding syntax or existence check for run.bat on Windows. Add a matrix step under runner.os == 'Windows' to lint or basic-check the batch script (e.g., cmd /c "run.bat /?") to catch errors early.
# Test run script (Linux/macOS)

lpolish added 3 commits June 9, 2025 23:18
- Update Jekyll version from 4.3.x to 4.2.2 to avoid mercenary gem --dry-run bug
- Simplify GitHub Actions workflow using official jekyll-build-pages action
- Fix invalid Liquid syntax in _config.yml (build_timestamp)
- Add comprehensive Jekyll exclusions to .gitignore and _config.yml
- Add webrick dependency for Ruby 3.0+ compatibility
- Update Gemfile.lock with compatible gem versions

Resolves the 'invalid option: --dry-run (OptionParser::InvalidOption)' error
that was preventing GitHub Pages from building successfully.
- Replace problematic jekyll-build-pages action with manual Ruby setup
- Update GitHub Actions workflow to use direct Jekyll build command
- Fix Jekyll configuration for better GitHub Pages compatibility
- Update gem dependencies for Ruby 3.x compatibility
- Remove unsupported --dry-run flag that was causing build failures
- Replace problematic 'jekyll build --dry-run' with 'jekyll doctor'
- Add deploy-pages.yml to paths-ignore to prevent CI conflicts
- Jekyll doctor provides configuration validation without build issues
@lpolish lpolish merged commit 93c1795 into main Jun 10, 2025
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant