Class: Tebako::BootstrapManager
- Inherits:
-
RuntimeManager
- Object
- RuntimeManager
- Tebako::BootstrapManager
- Defined in:
- lib/tebako/bootstrap_manager.rb
Overview
Resolution, download, verification and machine-wide caching of the tebako-bootstrap launcher binaries published by tamatebako/tebako-bootstrap. The launcher is the base binary of lean/fat three-part packages.
Cache layout (rooted at $TEBAKO_HOME or ~/.tebako, shared with the runtime package cache):
bootstraps/tebako-bootstrap-<version>-<platform>/
tebako-bootstrap-<version>-<platform>[.exe]
sha256 -- digest the installed file was verified against
origin -- URL the binary was downloaded from
All download/verify/lock machinery is inherited from RuntimeManager; only the release-shape specifics (asset naming, manifest.json object format, SHA256SUMS index name, mirror env var) differ.
Constant Summary collapse
- DEFAULT_MIRROR =
"https://github.com/tamatebako/tebako-bootstrap/releases/download"- BOOTSTRAPS_DIR =
"bootstraps"- INDEX_FILES =
["manifest.json", "SHA256SUMS"].freeze
- BOOTSTRAP_VERSION =
tebako-bootstrap release consumed by default (TEBAKO_BOOTSTRAP_VERSION overrides). 0.2.0 is the first release that installs a fat package's runtime payload slot into the cache at first run.
"0.2.0"- PAYLOAD_MIN_VERSION =
"0.2.0"
Constants inherited from RuntimeManager
RuntimeManager::DOWNLOAD_ATTEMPTS, RuntimeManager::LOCK_FILE, RuntimeManager::LOCK_TIMEOUT, RuntimeManager::ORIGIN_FILE, RuntimeManager::REDIRECT_LIMIT, RuntimeManager::RETRY_DELAY, RuntimeManager::RUNTIMES_DIR, RuntimeManager::RUNTIME_TYPE, RuntimeManager::SHA256_FILE, RuntimeManager::TMP_DIR
Instance Attribute Summary
Attributes inherited from RuntimeManager
Class Method Summary collapse
Instance Method Summary collapse
Methods inherited from RuntimeManager
default_cache_root, #entries, #initialize, layout, #layout, #prune
Constructor Details
This class inherits a constructor from Tebako::RuntimeManager
Class Method Details
.default_version ⇒ Object
58 59 60 61 |
# File 'lib/tebako/bootstrap_manager.rb', line 58 def default_version version = ENV.fetch("TEBAKO_BOOTSTRAP_VERSION", nil) version.nil? || version.empty? ? BOOTSTRAP_VERSION : version.sub(/\Av/, "") end |
.resolve(platform, bootstrap_version: default_version) ⇒ Object
63 64 65 |
# File 'lib/tebako/bootstrap_manager.rb', line 63 def resolve(platform, bootstrap_version: default_version) new.resolve(platform, bootstrap_version: bootstrap_version) end |
Instance Method Details
#resolve(platform, bootstrap_version: self.class.default_version) ⇒ Object
68 69 70 |
# File 'lib/tebako/bootstrap_manager.rb', line 68 def resolve(platform, bootstrap_version: self.class.default_version) super(bootstrap_version, platform, tebako_version: bootstrap_version) end |