Skip to content
Snippets Groups Projects
Commit 5fc73105 authored by Recolic K's avatar Recolic K
Browse files

better error reporting

parent fad42756
No related branches found
No related tags found
No related merge requests found
...@@ -188,7 +188,7 @@ function cis_get_job_status () { ...@@ -188,7 +188,7 @@ function cis_get_job_status () {
# Returns job summary in stderr, in plain text or markdown format. # Returns job summary in stderr, in plain text or markdown format.
jobid="$1" jobid="$1"
getjobhierarchy_apires=`curl_wrapped "https://beta-cps.trafficmanager.net/cis.client.svc/Public/$cis_namespace/GenericJob/$jobid/GetJobHierarchy"` && getjobhierarchy_apires=`curl_wrapped "https://beta-cps.trafficmanager.net/cis.client.svc/Public/$cis_namespace/GenericJob/$jobid/GetJobHierarchy"` &&
subworkflows_text=`echo "$getjobhierarchy_apires" | json2table DisplayName,Id,DisplayStatus,JobType -p` || ! echo2 "API GetJobHierarchy failed. Server says $getjobhierarchy_apires" || return $? subworkflows_text=`echo "$getjobhierarchy_apires" | json2table DisplayName,Id,DisplayStatus,JobType -p` || ! echo2 "API GetJobHierarchy failed. Server says '$getjobhierarchy_apires'" || return $?
callstack_formatted=`echo "$getjobhierarchy_apires" | json2table DisplayName,Id,DisplayStatus | grep -E '( InProgress )|( PlanError )'` # Ignore failure because it's only useful in InProgress and PlanError state. callstack_formatted=`echo "$getjobhierarchy_apires" | json2table DisplayName,Id,DisplayStatus | grep -E '( InProgress )|( PlanError )'` # Ignore failure because it's only useful in InProgress and PlanError state.
_mdcode='```' _mdcode='```'
...@@ -248,7 +248,7 @@ function cis_wait_for_upload () { ...@@ -248,7 +248,7 @@ function cis_wait_for_upload () {
try_grep_pkgid "$workflow_name" "$release_ver" && return 0 try_grep_pkgid "$workflow_name" "$release_ver" && return 0
[[ $novalidate != 1 ]] && upload_jobid=`curl_wrapped "https://beta-cps.trafficmanager.net/cis.client.svc/Public/$cis_namespace.$workflow_name/Packages?null" | json2table Actions/ActionLink,Version -p | grep -F "|$release_ver|" | grep -oE '[0-9]+_[0-9a-f-]{36}'` || continue # Ignore the failure because jobid need time to generate. [[ $novalidate != 1 ]] && upload_jobid=`curl_wrapped "https://beta-cps.trafficmanager.net/cis.client.svc/Public/$cis_namespace.$workflow_name/Packages?null" | json2table Actions/ActionLink,Version -p | grep -F "|$release_ver|" | grep -oE '[0-9]+_[0-9a-f-]{36}'` || continue # Ignore the failure because jobid need time to generate.
if [[ "$upload_jobid" != "" ]]; then if [[ "$upload_jobid" != "" ]]; then
upload_jobstat=`cis_namespace=System cis_get_job_status "$upload_jobid"` || ! echo2 "Failed to check the status of uploading job... The error checking is now disabled, and it might wait forever. " || novalidate=1 upload_jobstat=`cis_namespace=System cis_get_job_status "$upload_jobid"` || ! echo2 "Uploading request created successfully, but failed to check the status of uploading. The error checking is now disabled, and it might wait forever. " || novalidate=1
[[ "$upload_jobstat" = "Blocked" ]] || [[ "$upload_jobstat" = "Failed" ]] && echo2 "Uploading job $upload_jobstat. Stop waiting..." && return 2 [[ "$upload_jobstat" = "Blocked" ]] || [[ "$upload_jobstat" = "Failed" ]] && echo2 "Uploading job $upload_jobstat. Stop waiting..." && return 2
fi fi
done done
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment