Skip to content

Commit

Permalink
Add support for gziping install log if possible
Browse files Browse the repository at this point in the history
  • Loading branch information
ccressent committed Oct 27, 2023
1 parent 7737a54 commit 8c9599d
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions scripts/install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -164,9 +164,14 @@ EOF
}

function reporter {
echo "Reporting Sumo OpenTelemetry collector installation..."
echo "SUMOLOGIC_INSTALLATION_TOKEN=${SUMOLOGIC_INSTALLATION_TOKEN}" >> $INSTALLATION_LOGFILE
gzip < "${INSTALLATION_LOGFILE}" | curl --silent --location --post302 --header 'Content-Encoding:gzip' --data-binary @- "${INSTALLATION_LOGFILE_ENDPOINT}"
echo "Reporting Sumo OpenTelemetry collector installation..."
echo "SUMOLOGIC_INSTALLATION_TOKEN=${SUMOLOGIC_INSTALLATION_TOKEN}" >> $INSTALLATION_LOGFILE

if command -v "gzip" &> /dev/null; then
gzip < "${INSTALLATION_LOGFILE}" | curl --silent --location --post302 --header 'Content-Encoding:gzip' --data-binary @- "${INSTALLATION_LOGFILE_ENDPOINT}"
else
curl --silent --location --post302 --data-binary @"${INSTALLATION_LOGFILE}" "${INSTALLATION_LOGFILE_ENDPOINT}"
fi
}
trap reporter EXIT

Expand Down

0 comments on commit 8c9599d

Please sign in to comment.