mirror of
https://github.com/zeek/zeek.git
synced 2025-10-02 06:38:20 +00:00
Fix CI benchmark script to properly urlencode arguments
This commit is contained in:
parent
a82f743bcc
commit
b522f6ea08
1 changed files with 13 additions and 3 deletions
|
@ -35,14 +35,24 @@ TARGET="https://${ZEEK_BENCHMARK_HOST}:${ZEEK_BENCHMARK_PORT}${ZEEK_BENCHMARK_EN
|
||||||
set +e
|
set +e
|
||||||
|
|
||||||
# Make a request to the benchmark host.
|
# Make a request to the benchmark host.
|
||||||
RESULTS=$(curl -sS --stderr - --fail --insecure -X POST -H "Zeek-HMAC: ${HMAC_DIGEST}" -H "Zeek-HMAC-Timestamp: ${TIMESTAMP}" "${TARGET}?branch=${CIRRUS_BRANCH}&build=${BUILD_URL}&build_hash=${BUILD_HASH}&commit=${CIRRUS_CHANGE_IN_REPO}")
|
curl -sS -G --stderr - --fail --insecure -X POST \
|
||||||
|
-o "/zeek/benchmark-${TIMESTAMP}.log" \
|
||||||
|
-H "Zeek-HMAC: ${HMAC_DIGEST}" \
|
||||||
|
-H "Zeek-HMAC-Timestamp: ${TIMESTAMP}" \
|
||||||
|
--data-urlencode branch=${CIRRUS_BRANCH} \
|
||||||
|
--data-urlencode build=${BUILD_URL} \
|
||||||
|
--data-urlencode build_hash=${BUILD_HASH} \
|
||||||
|
--data-urlencode commit=${CIRRUS_CHANGE_IN_REPO} \
|
||||||
|
"${TARGET}"
|
||||||
|
|
||||||
STATUS=$?
|
STATUS=$?
|
||||||
|
|
||||||
# If we got a bad status back from the host, we want to make sure to mask the host
|
# If we got a bad status back from the host, we want to make sure to mask the host
|
||||||
# and port from the output.
|
# and port from the output.
|
||||||
if [ $STATUS -ne 0 ]; then
|
if [ $STATUS -ne 0 ]; then
|
||||||
RESULTS=$(echo "${RESULTS}" | sed "s/${ZEEK_BENCHMARK_HOST}/<secret>/g" | sed "s/:${ZEEK_BENCHMARK_PORT}/:<secret>/g")
|
cat /zeek/benchmark-${TIMESTAMP}.log | sed "s/${ZEEK_BENCHMARK_HOST}/<secret>/g" | sed "s/:${ZEEK_BENCHMARK_PORT}/:<secret>/g"
|
||||||
|
else
|
||||||
|
cat /zeek/benchmark-${TIMESTAMP}.log
|
||||||
fi
|
fi
|
||||||
|
|
||||||
echo "$RESULTS"
|
|
||||||
exit $STATUS
|
exit $STATUS
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue