provisioning/core/nulib/main_provisioning/versions.nu
Jesús Pérez 3c3ef47f7f
feat(taskserv): implement real-time version checking with configurable HTTP client
- Add: GitHub API integration for live version checking in taskserv management
- Add: HTTP client configuration option (http.use_curl) in config.defaults.toml
- Add: Helper function fetch_latest_version with curl/http get support
- Fix: Settings path structure for prov_data_dirpath access pattern
- Remove: Legacy simulation code for version checking
- Update: Core configuration name from "provisioning-system" to "provisioning"
- Clean: Remove obsolete example configs and infrastructure files
2025-09-24 01:55:06 +01:00

70 lines
2.1 KiB
Plaintext

# Version Management Commands
# Manages versions with progressive cache hierarchy
use ../lib_provisioning/cache/cache_manager.nu *
use ../lib_provisioning/cache/grace_checker.nu *
use ../lib_provisioning/cache/version_loader.nu *
use ../lib_provisioning/cache/batch_updater.nu *
# Get version for a specific component
export def "version get" [
component: string # Component name (e.g., kubernetes, containerd)
]: nothing -> string {
get-cached-version $component
}
# Show cache status and statistics
export def "version status" []: nothing -> nothing {
show-cache-status
}
# Initialize the cache system
export def "version init" []: nothing -> nothing {
print "🚀 Initializing version cache system..."
init-cache-system
print "✅ Cache system initialized"
}
# Clear all cached versions
export def "version clear" []: nothing -> nothing {
print "🧹 Clearing version cache..."
clear-cache-system
print "✅ Cache cleared"
}
# Update all cached versions in batches
export def "version update-all" []: nothing -> nothing {
print "🔄 Updating all cached versions..."
batch-update-all
print "✅ Cache updated"
}
# Invalidate a specific component's cache entry
export def "version invalidate" [
component: string # Component to invalidate
]: nothing -> nothing {
invalidate-cache-entry $component "infra"
invalidate-cache-entry $component "provisioning"
print $"✅ Invalidated cache for ($component)"
}
# List all available components
export def "version list" []: nothing -> list<string> {
get-all-components
}
# Sync cache from source (force refresh)
export def "version sync" [
component?: string # Optional specific component
]: nothing -> nothing {
if ($component | is-not-empty) {
invalidate-cache-entry $component "infra"
invalidate-cache-entry $component "provisioning"
let version = (get-cached-version $component)
print $"🔄 Synced ($component): ($version)"
} else {
version clear
version update-all
print "🔄 Synced all versions"
}
}