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:
@@ -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")
|
||||
|
||||
@@ -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"
|
||||
}
|
||||
Reference in New Issue
Block a user