From 2a8e25e0d0b46b3249c1c77b0c38219ebcdea1f0 Mon Sep 17 00:00:00 2001 From: Florin Sarbu Date: Wed, 7 Feb 2024 20:45:46 +0000 Subject: [PATCH] automation/include: Pass helper image version This is needed by the balena-push-env helper image that needs the balena-yocto-scripts version but has no way of getting that info otherwise. Change-type: patch Signed-off-by: Florin Sarbu --- automation/include/balena-deploy.inc | 16 +++++++++++----- automation/include/balena-lib.inc | 2 +- 2 files changed, 12 insertions(+), 6 deletions(-) mode change 100644 => 100755 automation/include/balena-lib.inc diff --git a/automation/include/balena-deploy.inc b/automation/include/balena-deploy.inc index 35f1cd917..7d1586fab 100644 --- a/automation/include/balena-deploy.inc +++ b/automation/include/balena-deploy.inc @@ -264,11 +264,15 @@ EOSU # $4: Path to the image to deploy # $5: Deploy release to S3 and balenaCloud fleet # $6: Deploy to balenaCloud fleet as draft (default) or final release -# $7: Path to the working directory (defaults to device repository root) -# $8: BalenaCloud admin account (defaults to balena_os) -# $9: BalenaCloud email address (defaults to the balenaCloudEmail enviromental variable) -# $10: BalenaCloud password (defaults to the balenaCloudPassword enviromental variable) -# $11: ESR release flag (default to "ESR" environment variable) +# $7: secureBoot feature flag +# - if set to yes this adds the secureBoot feature flag into the OS contract +# - needed for other components to identify secureBoot compatible software releases +# $8: Path to the working directory (defaults to device repository root) +# $9: BalenaCloud admin account (defaults to balena_os) +# $10: BalenaCloud email address (defaults to the balenaCloudEmail enviromental variable) +# $11: BalenaCloud password (defaults to the balenaCloudPassword enviromental variable) +# $12: ESR release flag (default to "ESR" environment variable) +# $13: Version of the helper image that is used to deploy the block # balena_deploy_block() { local _appName="$1" @@ -283,6 +287,7 @@ balena_deploy_block() { local _balenaCloudEmail="${10:-"${balenaCloudEmail}"}" local _balenaCloudPassword="${11:-"${balenaCloudPassword}"}" local _esr="${12}" + local _helperImageVersion="${13:-"${BALENA_YOCTO_SCRIPTS_VERSION}"}" local _api_env=$(balena_lib_environment) [ -z "${_device_type}" ] && echo "Device type is required" && return @@ -323,6 +328,7 @@ balena_deploy_block() { -e balenaCloudEmail="${_balenaCloudEmail}" \ -e balenaCloudPassword="${_balenaCloudPassword}" \ -e ESR="${_esr}" \ + -e BALENA_YOCTO_SCRIPTS_VERSION="${_helperImageVersion}" \ -v "${_image_path}":/host/appimage.docker \ -v "${device_dir}":/work \ -v "${_work_dir}":/deploy \ diff --git a/automation/include/balena-lib.inc b/automation/include/balena-lib.inc old mode 100644 new mode 100755 index b1bd0d7f6..7773b50c6 --- a/automation/include/balena-lib.inc +++ b/automation/include/balena-lib.inc @@ -7,7 +7,7 @@ VERBOSE=${VERBOSE:-0} include_dir=$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd ) device_dir=$( if cat /proc/self/cgroup | grep -q docker && [ -d "/work" ]; then cd "/work" && pwd; else cd "${include_dir}/../../.." && pwd; fi ) -BALENA_YOCTO_SCRIPTS_VERSION=$(cd "${include_dir}" && head -n1 ../../VERSION) +BALENA_YOCTO_SCRIPTS_VERSION="${BALENA_YOCTO_SCRIPTS_VERSION:-"$(cd "${include_dir}" && head -n1 ../../VERSION)"}" HELPER_IMAGE_REPO="${HELPER_IMAGE_REPO:-"ghcr.io/balena-os/balena-yocto-scripts"}" # Return the latest tag of the device repository