From 3a5bfa82c3fbb6f8a85bb23604f2206ce9c5ffb3 Mon Sep 17 00:00:00 2001 From: ab77 Date: Tue, 14 Nov 2023 09:50:43 -0800 Subject: [PATCH] pin device to release change-type: patch --- resources/resincli.robot | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) diff --git a/resources/resincli.robot b/resources/resincli.robot index 7f6ece6..0922509 100644 --- a/resources/resincli.robot +++ b/resources/resincli.robot @@ -84,11 +84,23 @@ Get "${device_info}" of device "${device_uuid}" Process ${result} [Return] ${result.stdout} -Get "${application_info}" from application "${application_name}" +Get "${application_info}" from fleet "${application_name}" [Documentation] Available values for argument ${application_info} are: ... ID, APP_NAME, DEVICE_TYPE, ONLINE_DEVICES, DEVICES_LENGTH - &{dictionary} = Create Dictionary ID=1 APP_NAME=2 DEVICE_TYPE=3 ONLINE_DEVICES=4 DEVICES_LENGTH=5 - ${result} = Run Process balena apps | grep -w "${application_name}" | awk '{print $${dictionary.${application_info}}}' shell=yes + &{dictionary} = Create Dictionary ID=1 APP_NAME=2 SLUG=3 DEVICE_TYPE=4 DEVICES_LENGTH=5 ONLINE_DEVICES=6 + ${result} = Run Process balena fleets | grep -w "${application_name}" | awk '{print $${dictionary.${application_info}}}' shell=yes + Process ${result} + [Return] ${result.stdout} + +# FIXME: needs to select STATUS=success and IS FINAL=true +Get latest release from fleet "${application_name}" + ${result} = Run Process balena releases "${application_name}" | head -n 2 | tail -n 1 | awk '{print $2}' shell=yes + Process ${result} + [Return] ${result.stdout} + +# FIXME: needs to select STATUS=success and IS FINAL=true +Get previous release from fleet "${application_name}" + ${result} = Run Process balena releases "${application_name}" | head -n 3 | tail -n 2 | tail -n 1 | awk '{print $2}' shell=yes Process ${result} [Return] ${result.stdout}