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

make old git-bash happy

parent 5fc73105
No related branches found
No related tags found
No related merge requests found
......@@ -195,7 +195,7 @@ function cis_get_job_status () {
if planerror_callstack=`echo "$subworkflows_text" | grep -F '|PlanError|'`; then
# RemoteJob may have PlanError in subworkflow. The top-level workflow is still InProgress but bottom workflow got PlanError.
[[ -z "$callstack_formatted" ]] && echo2 "API GetJobHierarchy result misinterpreted. No workflow in stat InProgress or PlanError. This is an unexpected non-fatal error and I did not catch it. " && return 2
[[ ! -v ANTIDOTE_JOBSTAT_MARKDOWN ]] &&
[[ ! -z $ANTIDOTE_JOBSTAT_MARKDOWN ]] &&
echo2 -e ">>> CIS reported PlanError:\nCallstack: \n$callstack_formatted\nCIS Log: https://beta-cps.trafficmanager.net/Public/$cis_namespace/JobDetails/$jobid" ||
echo2 -e "## CIS reported PlanError\n\n[View CIS Log](https://beta-cps.trafficmanager.net/Public/$cis_namespace/JobDetails/$jobid)\n\n### Callstack\n\n$_mdcode\n$callstack_formatted\n$_mdcode\n"
echo "Failed" && return 0
......@@ -216,7 +216,7 @@ function cis_get_job_status () {
if echo "$bottom_wf_activities" | tr -d ' ' | grep -F '|Blocked|' > /dev/null; then
# I found some activity blocked! Show incident and exit.
icm_link=`echo "$bottom_wf_pagedtasks_apires" | json2table Data/Tasks/Incidents/ExternalLink -p | sed 's/VAL: //g' | tr -d '|'` || icm_link=""
[[ ! -v ANTIDOTE_JOBSTAT_MARKDOWN ]] &&
[[ ! -z $ANTIDOTE_JOBSTAT_MARKDOWN ]] &&
echo2 -e ">>> Incident detected:\nCallstack: \n$callstack_formatted\nActivity: \n$bottom_wf_activities\nCIS Log: https://beta-cps.trafficmanager.net/Public/$cis_namespace/JobDetails/$jobid\nICM Link: $icm_link" ||
echo2 -e "## Incident detected\n\n[View CIS Log](https://beta-cps.trafficmanager.net/Public/$cis_namespace/JobDetails/$jobid)\n\n### Callstack\n\n$_mdcode\n$callstack_formatted\n$_mdcode\n\n### Activity\n\n$_mdcode\n$bottom_wf_activities\n$_mdcode\n[View ICM Incident]($icm_link)"
echo "Blocked" && return 0
......@@ -229,7 +229,7 @@ function cis_get_job_status () {
# Since the first line is the root workflow. If it's not InProgress, then we can trust the DisplayStatus. Just print it out.
echo "$subworkflows_text" | grep -vF 'DisplayName|DisplayStatus|Id' | head -n 1 | cut -d '|' -f 2
[[ ! -v ANTIDOTE_JOBSTAT_MARKDOWN ]] &&
[[ ! -z $ANTIDOTE_JOBSTAT_MARKDOWN ]] &&
echo2 -e "CIS Log: https://beta-cps.trafficmanager.net/Public/$cis_namespace/JobDetails/$jobid" ||
echo2 -e "[View CIS Log](https://beta-cps.trafficmanager.net/Public/$cis_namespace/JobDetails/$jobid)"
return $?
......@@ -396,7 +396,7 @@ antidote-cis cloudrun BuildDomainControllerWorkflow jihyan.9.24.2 IsFirstDC=true
antidote-cis jobstatus 2517645620722579999_df3a452e-d580-47c2-b96e-61f1671358c9
Available env:
ANTIDOTE_JOBSTAT_MARKDOWN: If this var is set, 'jobstatus' would output as markdown instead of plain text.
ANTIDOTE_JOBSTAT_MARKDOWN: If this variable is not empty, 'jobstatus' would output as markdown instead of plain text.
"
exit 1
esac
......
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