Class: Tebako::Cli
- Inherits:
-
Thor
- Object
- Thor
- Tebako::Cli
- Defined in:
- lib/tebako/cli.rb
Overview
Tebako packager front-end
Constant Summary collapse
- CWD_DESCRIPTION =
"Current working directory for packaged application. This directory shall be specified relative to root.\n\#{\" \" * 65}# If this parameter is not set, the application will start in the current directory of the host file system.\n"- REF_DESCRIPTION =
"\"Referenced tebako run-time package; 'tebako-runtime' by default\".\n\#{\" \" * 65}# This option specifies the tebako runtime to be used by the application on Windows and if mode is 'application' only .\n"- RGP_DESCRIPTION =
"Current working directory for packaged application. This directory shall be specified relative to root.\n\#{\" \" * 65}# If this parameter is not set, the application will start in the current directory of the host file system.\n"- RUNTIME_DESCRIPTION =
"Runtime provenance: 'prebuilt' resolves/downloads a prebuilt tebako runtime package (default for the\n\#{\" \" * 65}# 'bundle', 'classic', 'lean' and 'fat' modes); 'source' keeps the Stage-2 source build\n\#{\" \" * 65}# (not available for 'lean'/'fat' -- the bootstrap resolves tebako-runtime-ruby releases\n\#{\" \" * 65}# at run time). Modes other than those always build from source.\n"- IMAGE_DESCRIPTION =
"Additional image to stitch into the package, '<path>:<mount-point>'; repeatable, mount points\n\#{\" \" * 65}# must be distinct. Prebuilt runtime only.\n"- MODE_DESCRIPTION =
"Tebako press mode, 'lean' by default.\n\#{\" \" * 65}# 'lean' presses a three-part package (tebako-bootstrap + application image(s) + tpkg trailer);\n\#{\" \" * 65}# the runtime is resolved into the shared cache at first run.\n\#{\" \" * 65}# 'fat' is 'lean' plus the runtime package as a payload slot -- the first run installs it\n\#{\" \" * 65}# into the cache without network access.\n\#{\" \" * 65}# 'classic' stitches the application image onto a prebuilt runtime (Stage-3A layout);\n\#{\" \" * 65}# 'bundle', 'both', 'application' and 'runtime' keep their legacy behaviors.\n"
Class Method Summary collapse
Instance Method Summary collapse
Class Method Details
.exit_on_failure? ⇒ Boolean
245 246 247 |
# File 'lib/tebako/cli.rb', line 245 def self.exit_on_failure? true end |
Instance Method Details
#clean ⇒ Object
131 132 133 134 135 |
# File 'lib/tebako/cli.rb', line 131 def clean (om, cm) = bootstrap(clean: true) cm.clean_cache extra_win_clean([om.deps]) end |
#clean_ruby ⇒ Object
141 142 143 144 145 146 147 148 149 150 151 |
# File 'lib/tebako/cli.rb', line 141 def clean_ruby puts "Cleaning Ruby sources from tebako packaging environment" (om,) = bootstrap(clean: true) suffix = ["Ruby"].nil? ? "" : "_#{options["Ruby"]}" nmr = Dir.glob(File.join(om.deps, "src", "_ruby#{suffix}*")) nms = Dir.glob(File.join(om.deps, "stash#{suffix}*")) FileUtils.rm_rf(nmr + nms, secure: true) extra_win_clean(nmr) end |
#hash ⇒ Object
154 155 156 |
# File 'lib/tebako/cli.rb', line 154 def hash print Digest::SHA256.hexdigest [File.read(File.join(source, "CMakeLists.txt")), Tebako::VERSION].join end |
#press ⇒ Object
220 221 222 223 224 225 226 227 228 229 |
# File 'lib/tebako/cli.rb', line 220 def press (om, cm) = bootstrap do_press(om) cm.ensure_version_file rescue Tebako::Error => e puts "Tebako script failed: #{e.message} [#{e.error_code}]" exit e.error_code end |
#setup ⇒ Object
235 236 237 238 239 240 241 242 243 |
# File 'lib/tebako/cli.rb', line 235 def setup (om, cm) = bootstrap do_setup(om) cm.ensure_version_file rescue Tebako::Error => e puts "Tebako script failed: #{e.message} [#{e.error_code}]" exit e.error_code end |