Skip to content

Instantly share code, notes, and snippets.

@toolmantim
Created October 24, 2017 04:50
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save toolmantim/146944ea39123ebee63c6f1b02c00a4e to your computer and use it in GitHub Desktop.
Save toolmantim/146944ea39123ebee63c6f1b02c00a4e to your computer and use it in GitHub Desktop.
An example of using BlazeMeter with Buildkite
#!/bin/bash
# Creates a new Blazemeter test with the given BLAZEMETER_TEST_ID env var
#
# Requires BLAZEMETER_API_ID and BLAZEMETER_API_SECRET environment variables be
# setup on the agent as per:
# https://buildkite.com/docs/agent/securing#using-environment-hooks-for-secrets
set -euo pipefail
echo "~~~ Starting Backblaze test"
echo "Starting test ${BLAZEMETER_TEST_ID}..."
response=$(
curl -X POST \
--include \
-H "Content-Type: application/json" \
--user "${BLAZEMETER_API_ID}:${BLAZEMETER_API_SECRET}" \
"https://a.blazemeter.com:443/api/v4/tests/${BLAZEMETER_TEST_ID}/start"
)
echo "$response"
# Check for success and ensure the
echo "$response" | grep '"error": null' --silent
steps:
- command: "blazemeter.sh"
label: ":blazemeter:"
artifact_paths: ""
env:
BLAZEMETER_TEST_ID: 5351050
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment