[["$cis_bearer$cis_cookie"=""]]&& echo2 "Warning: You must set either cis_cookie or cis_bearer to authenticate your CIS API call, but you have set neither. curl requests is very likely to fail!"
...
...
@@ -63,11 +63,11 @@ function cis_upload_pkg () {
if[["${pkg_path:0:6}"="cis://"]];then
echo2 "Submitting request to upload package $cis_namespace.$workflow_name:$release_ver, using CIS internal package (trigger argless upload)..."
@@ -137,7 +137,7 @@ function assemble_workflow_parameters () {
# Use variable $cis_default_workflow_parameter, query workflow parameter list, and fill them.
# The tail of array variable $cis_default_workflow_parameter has higher preference (because params from command line are appended after tail)
workflow_name="$1"
params_query_response=`curl_wrapped -s"https://beta-cps.trafficmanager.net/cis.client.svc/Public/JobTypeDefinition/$cis_namespace" | json2table WorkflowDefinitions/InputParameters,Name -p | grep"|$workflow_name|" | cut-d'|'-f 1`||! echo2 "Failed to get Workflow definition for workflow $workflow_name"||return$?
params_query_response=`curl_wrapped "https://beta-cps.trafficmanager.net/cis.client.svc/Public/JobTypeDefinition/$cis_namespace" | json2table WorkflowDefinitions/InputParameters,Name -p | grep"|$workflow_name|" | cut-d'|'-f 1`||! echo2 "Failed to get Workflow definition for workflow $workflow_name"||return$?
[["$params_query_response"="[]"]]&¶ms=""||params=`echo"$params_query_response" | json2table Name -p | sed's/VAL: //g' | grep-oE'[A-Za-z0-9_-]+'`||! echo2 "Failed to get Workflow definition for workflow $workflow_name"||return$?
job_id=`curl_wrapped -s"https://beta-cps.trafficmanager.net/cis.client.svc/Public/$cis_namespace/GenericJob?workflowDefinitionName=$workflow_name"-H'content-type: application/json'--data'{"JobType":"'"$cis_namespace"'","Workflow":"'"$workflow_name"'","ServiceHostCapability":"AzureJB","ServiceHostLocation":"Any","RuntimePackageId":"4dd32e8b-6bc7-478e-a1ab-48fcdc1bf3d3","PackageId":"'"$pkg_id"'","DisplayName":"Antidote-autosubmitted-WF","WorkflowParameters":{'"$workflow_params"'},"RuntimeSettings":{'"$runtime_settings"'},"WorkflowSettings":{"RuntimeSettings":{'"$runtime_settings"'}}}'`||! echo2 "failed to get job_id"||return$?
job_id=`curl_wrapped "https://beta-cps.trafficmanager.net/cis.client.svc/Public/$cis_namespace/GenericJob?workflowDefinitionName=$workflow_name"-H'content-type: application/json'--data'{"JobType":"'"$cis_namespace"'","Workflow":"'"$workflow_name"'","ServiceHostCapability":"AzureJB","ServiceHostLocation":"Any","RuntimePackageId":"4dd32e8b-6bc7-478e-a1ab-48fcdc1bf3d3","PackageId":"'"$pkg_id"'","DisplayName":"Antidote-autosubmitted-WF","WorkflowParameters":{'"$workflow_params"'},"RuntimeSettings":{'"$runtime_settings"'},"WorkflowSettings":{"RuntimeSettings":{'"$runtime_settings"'}}}'`||! echo2 "failed to get job_id"||return$?
[["$job_id"=~ ^[0-9][0-9]*_[0-9a-f-]*$ ]]||! echo2 "Failed to create job. Invalid cookie or invalid workflow_name?"||return 3
echo2 "Waiting for CIS to create job... (job_id=$job_id)"