mirror of
https://github.com/flatcar/scripts.git
synced 2025-08-09 22:16:58 +02:00
Merge pull request #485 from marineam/sdk
common: set properly COREOS_SDK_VERSION
This commit is contained in:
commit
a20129cafb
13
common.sh
13
common.sh
@ -242,10 +242,12 @@ load_environment_whitelist() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
load_environment_var() {
|
load_environment_var() {
|
||||||
local file="$1" name="$2"
|
local file="$1" name value
|
||||||
local value
|
shift
|
||||||
|
for name in "$@"; do
|
||||||
value=$(grep "^${name}=" "${file}")
|
value=$(grep "^${name}=" "${file}")
|
||||||
export "${value}"
|
export "${value}"
|
||||||
|
done
|
||||||
}
|
}
|
||||||
|
|
||||||
# Find root of source tree
|
# Find root of source tree
|
||||||
@ -273,13 +275,14 @@ REPO_MANIFESTS_DIR="${REPO_ROOT}/.repo/manifests"
|
|||||||
|
|
||||||
# Source COREOS_VERSION_ID from manifest.
|
# Source COREOS_VERSION_ID from manifest.
|
||||||
if [[ -f "${REPO_MANIFESTS_DIR}/version.txt" ]]; then
|
if [[ -f "${REPO_MANIFESTS_DIR}/version.txt" ]]; then
|
||||||
load_environment_var "${REPO_MANIFESTS_DIR}/version.txt" COREOS_VERSION_ID
|
load_environment_var "${REPO_MANIFESTS_DIR}/version.txt" \
|
||||||
|
COREOS_VERSION_ID COREOS_SDK_VERSION
|
||||||
# The build id may be provided externally by the build system.
|
# The build id may be provided externally by the build system.
|
||||||
: ${COREOS_BUILD_ID:=$(date +%Y-%m-%d-%H%M)}
|
: ${COREOS_BUILD_ID:=$(date +%Y-%m-%d-%H%M)}
|
||||||
elif [[ -f "${SCRIPT_LOCATION}/version.txt" ]]; then
|
elif [[ -f "${SCRIPT_LOCATION}/version.txt" ]]; then
|
||||||
load_environment_var "${SCRIPT_LOCATION}/version.txt" COREOS_VERSION_ID
|
|
||||||
# This only happens in update.zip where we must use the current build id.
|
# This only happens in update.zip where we must use the current build id.
|
||||||
load_environment_var "${SCRIPT_LOCATION}/version.txt" COREOS_BUILD_ID
|
load_environment_var "${SCRIPT_LOCATION}/version.txt" \
|
||||||
|
COREOS_VERSION_ID COREOS_BUILD_ID COREOS_SDK_VERSION
|
||||||
else
|
else
|
||||||
die "Unable to locate version.txt"
|
die "Unable to locate version.txt"
|
||||||
fi
|
fi
|
||||||
|
Loading…
Reference in New Issue
Block a user