diff options
author | Andrey Lihatskiy <alihatskiy@productengine.com> | 2023-10-25 21:33:05 +0300 |
---|---|---|
committer | Andrey Lihatskiy <alihatskiy@productengine.com> | 2023-10-25 21:33:05 +0300 |
commit | 2740d2befc688ceb1dfcf56b44c03079c6755e58 (patch) | |
tree | 53db41b7fea5d33610bb9110927fc16537d9ddfc /buildscripts_support_functions | |
parent | 936b66b8307fee405a43a11b579a0178958111a4 (diff) | |
parent | 2e8e96cfbcb383a667d1b938f364f0bbafcad5b4 (diff) |
Merge branch 'main' into DRTVWR-594-maint-Y
Diffstat (limited to 'buildscripts_support_functions')
-rw-r--r-- | buildscripts_support_functions | 60 |
1 files changed, 60 insertions, 0 deletions
diff --git a/buildscripts_support_functions b/buildscripts_support_functions new file mode 100644 index 0000000000..557d2f80fb --- /dev/null +++ b/buildscripts_support_functions @@ -0,0 +1,60 @@ +# standalone functions from sling-buildscripts + +set_build_number_to_revision() +{ + record_event "buildNumber $revision" +} + +record_event() +{ + echo "=== $@" +} + +begin_section() +{ + record_event "START $*" + sections+=("$*") +} + +end_section() +{ + # accommodate dumb Mac bash 3, which doesn't understand array[-1] + local last=$(( ${#sections[@]} - 1 )) + record_event "END ${*:-${sections[$last]}}" + unset "sections[$last]" +} + +record_success() +{ + record_event "SUCCESS $*" +} + +record_failure() +{ + record_event "FAILURE $*" >&2 +} + +fatal() +{ + record_failure "$@" + finalize false + exit 1 +} + +# redefined fail for backward compatibility +alias fail=fatal + +pass() +{ + exit 0 +} + +export -f set_build_number_to_revision +export -f record_event +export -f begin_section +export -f end_section +export -f record_success +export -f record_failure +export -f fatal +export -f pass +export sections |