aboutsummaryrefslogtreecommitdiff
path: root/brep/handler/ci/ci-load.in
diff options
context:
space:
mode:
Diffstat (limited to 'brep/handler/ci/ci-load.in')
-rw-r--r--brep/handler/ci/ci-load.in29
1 files changed, 28 insertions, 1 deletions
diff --git a/brep/handler/ci/ci-load.in b/brep/handler/ci/ci-load.in
index d568341..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.
@@ -277,7 +294,7 @@ run mv "$cache_dir/packages.manifest" "$cache_dir/packages.manifest.orig"
#
manifest_serializer_start "$cache_dir/packages.manifest"
-for ((i=0; i <= "${#packages_manifest_names[@]}"; ++i)); do
+for ((i=0; i != "${#packages_manifest_names[@]}"; ++i)); do
manifest_serialize "${packages_manifest_names[$i]}" \
"${packages_manifest_values[$i]}"
done
@@ -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.