Skip to content
This repository has been archived by the owner on Dec 19, 2022. It is now read-only.

Commit

Permalink
Append custom data to job collector [semver:minor] (#31)
Browse files Browse the repository at this point in the history
* Add support for custom data.
  • Loading branch information
sumo-drew authored Feb 9, 2021
1 parent 5f51009 commit 46d3bc2
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions src/jobs/workflow-collector.yml
Original file line number Diff line number Diff line change
Expand Up @@ -211,6 +211,16 @@ steps:
JOB_DATA_RAW=$(echo $JOB_DATA_RAW | jq 'del(.circle_yml)' | jq 'del(.steps)')
# manually set job name as it is currently null
JOB_DATA_RAW=$(echo $JOB_DATA_RAW | jq --arg JOBNAME "$JOB_NAME" '.job_name = $JOBNAME')
# Append any custom data to the job data
if [[ ! -z '<< parameters.custom-data >>' ]] && echo "$CUSTOM_DATA" | jq -e;
then
echo "Appending custom data to the workflow data"
JOB_DATA_RAW=$(echo $JOB_DATA_RAW | jq -c ". + {\"custom_data\": $CUSTOM_DATA}")
else
echo "No valid custom data found to append to the job data"
fi
# Write the modified data to a file
echo $JOB_DATA_RAW > /tmp/sumologic-logs/job-collector.json
curl -s -X POST -T /tmp/sumologic-logs/job-collector.json $<< parameters.job-collector >>
Expand Down

0 comments on commit 46d3bc2

Please sign in to comment.