diff options
author | Karen Arutyunov <karen@codesynthesis.com> | 2024-02-22 11:17:25 +0300 |
---|---|---|
committer | Karen Arutyunov <karen@codesynthesis.com> | 2024-02-22 11:18:08 +0300 |
commit | d4900d85f7a5d791f89821713d02d3dd19361044 (patch) | |
tree | 4e7a1cc241d108c89779df9ec62f144a62937c17 /brep/handler/ci/ci-load.in | |
parent | f5ed92e8dbdfd751276ebb054669ca649b28e43c (diff) |
Add support for tenant-associated service notifications
Diffstat (limited to 'brep/handler/ci/ci-load.in')
-rw-r--r-- | brep/handler/ci/ci-load.in | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/brep/handler/ci/ci-load.in b/brep/handler/ci/ci-load.in index dbdc450..3f04ea8 100644 --- a/brep/handler/ci/ci-load.in +++ b/brep/handler/ci/ci-load.in @@ -108,6 +108,13 @@ declare -A packages # spec= +# Third party service information which, if specified, needs to be associated +# with the being created tenant. +# +service_id= +service_type= +service_data= + while IFS=: read -ru "$manifest_parser_ofd" -d '' n v; do case "$n" in repository) repository="$v" ;; @@ -122,6 +129,10 @@ while IFS=: read -ru "$manifest_parser_ofd" -d '' n v; do fi spec="$spec$v" ;; + + service-id) service_id="$v" ;; + service-type) service_type="$v" ;; + service-data) service_data="$v" ;; esac done @@ -141,6 +152,12 @@ if [[ -n "$simulate" && "$simulate" != "success" ]]; then exit_with_manifest 400 "unrecognized simulation outcome '$simulate'" fi +# Use the generated reference if the tenant service id is not specified. +# +if [[ -n "$service_type" && -z "$service_id" ]]; then + service_id="$reference" +fi + message_suffix= if [[ -n "$result_url" ]]; then message_suffix=": $result_url/@$reference" # Append the tenant id. @@ -306,6 +323,16 @@ if [[ -n "$interactive" ]]; then loader_options+=(--interactive "$interactive") fi +# Pass the tenant service information, if specified, to the loader. +# +if [[ -n "$service_id" ]]; then + loader_options+=(--service-id "$service_id" --service-type "$service_type") + + if [[ -n "$service_data" ]]; then + loader_options+=(--service-data "$service_data") + fi +fi + run "$loader" "${loader_options[@]}" "$loadtab" # Remove the no longer needed CI request data directory. |