Class: RosettAi::Thor::Tasks::BuildEngine

Inherits:
Thor
  • Object
show all
Includes:
Formatting
Defined in:
lib/rosett_ai/thor/tasks/build.rb

Overview

Thor subcommand for building a .deb package for an rosett-ai engine plugin.

Replaces the per-engine packaging/build-deb.sh shell scripts with a unified Ruby implementation that auto-detects engine name and version from the gemspec, derives the Ruby ABI from the current runtime, and packages with fpm.

Build tooling references: fpm — https://github.com/jordansissel/fpm

Constant Summary collapse

INSTALL_BASE =
'/opt/rosett-ai/embedded/lib/ruby/gems'

Constants included from Formatting

Formatting::SIZE_UNITS

Instance Method Summary collapse

Methods included from Formatting

#format_duration, #format_size

Instance Method Details

#createObject



888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
# File 'lib/rosett_ai/thor/tasks/build.rb', line 888

def create
  resolve_engine_dir!
  detect_gemspec!
  parse_gemspec!
  print_engine_header

  run_stage(:validate) { validate_engine_environment! }
  run_stage(:gem_build) { build_gem! }
  run_stage(:staging) { prepare_staging! }
  run_stage(:gem_install) { install_gem_to_staging! }
  run_stage(:package) { build_engine_package! }

  print_engine_summary(:success)
rescue ::Thor::Error => e
  print_engine_summary(:failed) unless @summary_printed
  raise e
end