From add5689cd92750dc2549b8f6102fa0edf0f246cc Mon Sep 17 00:00:00 2001 From: Florin Sarbu Date: Sat, 16 Nov 2024 08:14:37 +0000 Subject: [PATCH] github/workflows/yocto-build-deploy.yml: Add hostapp metadata to OS release This is needed for supervisor managed OS updates. For example, the supervisor can check this metadata against the equivalent field from /etc/os-release to determine if the device is already running the latest OS release. Change-type: patch Signed-off-by: Florin Sarbu --- .github/workflows/yocto-build-deploy.yml | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/.github/workflows/yocto-build-deploy.yml b/.github/workflows/yocto-build-deploy.yml index 59f2233fd..0ba6eb2be 100644 --- a/.github/workflows/yocto-build-deploy.yml +++ b/.github/workflows/yocto-build-deploy.yml @@ -382,6 +382,9 @@ jobs: meta_balena_version="$(balena_lib_get_meta_balena_base_version)" echo "meta_balena_version=${meta_balena_version}" >>"${GITHUB_OUTPUT}" + device_repo_revision="$(git rev-parse --short HEAD)" + echo "device_repo_revision=${device_repo_revision}" >>"${GITHUB_OUTPUT}" + yocto_scripts_ref="$(git submodule status balena-yocto-scripts | awk '{print $1}')" echo "yocto_scripts_ref=${yocto_scripts_ref}" >>"${GITHUB_OUTPUT}" @@ -693,6 +696,7 @@ jobs: BALENAOS_ACCOUNT: ${{ vars.HOSTAPP_ORG || 'balena_os' }} SLUG: "${{ steps.balena-lib.outputs.device_slug }}" APPNAME: "${{ steps.balena-lib.outputs.device_slug }}" + DEVICE_REPO_REV: "${{ steps.balena-lib.outputs.device_repo_revision }}" META_BALENA_VERSION: "${{ steps.balena-lib.outputs.meta_balena_version }}" RELEASE_VERSION: "${{ steps.balena-lib.outputs.os_version }}" BOOTABLE: 1 @@ -814,9 +818,21 @@ jobs: fi #[ "${VERBOSE}" = "verbose" ] && _debug="--debug" + # create docker-compose.yml with OS release metadata for the hostapp + cat > "${WORKSPACE}/docker-compose.yml" <