2
0
mirror of https://github.com/xcat2/xcat-core.git synced 2026-10-21 15:18:19 +00:00

refactor(genesis): share deploy artifact resolution

This commit is contained in:
Vinícius Ferrão
2026-10-12 18:15:17 -03:00
parent 045ee1c327
commit 846515d019
3 changed files with 10 additions and 14 deletions
+2 -7
View File
@@ -37,13 +37,8 @@ machine_dir=$deploy_dir/images/$machine
image_name=xcat-genesis-image-$machine.rootfs
license_machine=${machine//-/_}
resolve_artifact() {
local path=$1 resolved
resolved=$(readlink -f -- "$path")
[[ -f $resolved && ! -L $resolved ]] || fail "missing artifact: $path"
printf '%s\n' "$resolved"
}
script_dir=$(CDPATH='' cd -- "$(dirname -- "${BASH_SOURCE[0]}")" && pwd)
source "$script_dir/scripts/export-functions"
kernel=$(resolve_artifact "$machine_dir/$kernel_name")
initramfs=$(resolve_artifact "$machine_dir/$image_name.cpio.gz")
+1 -7
View File
@@ -40,13 +40,7 @@ machine_dir=$deploy_dir/images/$machine
stem=$extension-$machine
artifact_stem=$stem.sysext
resolve_artifact() {
local path=$1 resolved
resolved=$(readlink -f -- "$path")
[[ -f $resolved && ! -L $resolved ]] || fail "missing artifact: $path"
printf '%s\n' "$resolved"
}
source "$script_dir/scripts/export-functions"
image=$(resolve_artifact "$machine_dir/$artifact_stem.squashfs-zst")
manifest=$(resolve_artifact "$machine_dir/$artifact_stem.manifest.json")
@@ -0,0 +1,7 @@
resolve_artifact() {
local path=$1 resolved
resolved=$(readlink -f -- "$path")
[[ -f $resolved && ! -L $resolved ]] || fail "missing artifact: $path"
printf '%s\n' "$resolved"
}