70 lines
2.1 KiB
Plaintext
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"
|
||
|
}
|
||
|
}
|