mirror of
https://github.com/flatcar/scripts.git
synced 2026-05-04 19:56:32 +02:00
Merge pull request #487 from marineam/sdk
build_image: fix generation of version.txt
This commit is contained in:
commit
dca121d83f
@ -182,10 +182,11 @@ then
|
||||
fi
|
||||
|
||||
# Write out a version.txt file, this will be used by image_to_vm.sh
|
||||
split_ver "${COREOS_VERSION_ID}" SPLIT
|
||||
tee "${BUILD_DIR}/version.txt" <<EOF
|
||||
COREOS_BUILD=${COREOS_BUILD}
|
||||
COREOS_BRANCH=${COREOS_BRANCH}
|
||||
COREOS_PATCH=${COREOS_PATCH}
|
||||
COREOS_BUILD=${SPLIT[0]}
|
||||
COREOS_BRANCH=${SPLIT[1]}
|
||||
COREOS_PATCH=${SPLIT[2]}
|
||||
COREOS_VERSION=${COREOS_VERSION_STRING}
|
||||
COREOS_VERSION_ID=${COREOS_VERSION_ID}
|
||||
COREOS_BUILD_ID="${COREOS_BUILD_ID}"
|
||||
|
||||
14
common.sh
14
common.sh
@ -172,6 +172,20 @@ cmp_ver() {
|
||||
return $?
|
||||
}
|
||||
|
||||
# Split a semver into a 3 item array (major minor patch)
|
||||
# Usage: split_ver 1.2.3 NAME
|
||||
split_ver() {
|
||||
local v="$1" n="$2"
|
||||
v="${v%%-*}" # strip off pre-release suffix
|
||||
v="${v%%+*}" # strip off build id suffix
|
||||
v="${v//./ }"
|
||||
local -a a="(${v})"
|
||||
if [[ ${#a[@]} -ne 3 ]]; then
|
||||
die "Invalid version string '$1'"
|
||||
fi
|
||||
declare -g -a ${n}="(${v})"
|
||||
}
|
||||
|
||||
# repo source root inside the chroot, usually mounted from the outside.
|
||||
CHROOT_TRUNK_DIR="/mnt/host/source"
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user